I installed KVM via synaptic from Ubuntu repositories, and now my computer won't boot. - kvm

2 week old Ubuntu 18.04 install.
As a requirement of running a android device emulator for Android studio, I had to install KVM, so I installed it (the exact package name was kvm, it had some dependencies), and now my computer won't boot. It just sits there with a purple screen.
No keyboard or mouse input has any effect (including REISUB).
I have googled and nothing relevant comes up (it's all about booting VMs, understandably).
I have no idea what to do, especially since I cannot interact directly with my OS.
I still have my boot stick (that I used to install 18.04), and I can boot off that.

Turns out that installing linux-kvm actually doesn't install a VM program, it just installs another kernal that's obsolete, puts it at the top of the grub list, and that's how it breaks your computer.
I fixed it by using boot-repair (https://help.ubuntu.com/community/Boot-Repair).

Related

WSL2 stopped working with error The system cannot find the path specified

WSL2 stopped working suddenly. If I do a new installation of linux distros. Then it throws the following error, when I click launch button for the linux distro from play store:
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070003
Error: 0x80070003 The system cannot find the path specified.
the wsl --help command works properly. All other wsl command hangs or throws error as shown below
like wsl -l command throws this error
The system cannot find the path specified.
I had the same thing happening to me after I moved the directory of my distro.
You have to unregister the distro from WSL;
wslconfig /u Ubuntu-20.04
and then just execute the installed exe and install the whole distro to WSL again.
I had to reinstall the windows to fix the issue. Something got corrupted in the OS. However, before reinstalling the OS as I had lot of work stored in the WSL2, I took the backup of the entire WSL2 image, the big .vhdx file. This file is the Virtual Hard Disk of WSL2 Linux. The files inside cannot be directly explored from Windows at the moment.
If one has not moved the file anywhere else, it is stored here: %LOCALAPPDATA%\Packages\<PackageFamilyName>\LocalState\ext4.vhdx
Before reinstalling the OS, after taking the backup, I wanted to test if this backup runs fine on new install of WSL2. For that, I tested it on another machine, by installing the same Ubuntu WSL2 distro and replacing the .vhdx file created with the backup file. It ran fine.
So, it felt safe to do entire OS reinstall and then reinstalling WSL2 Ubuntu and finally replacing the .vhdx file with the old backup .vhdx file. So, I did loose some time. But, my data and all the applications/programs on WSL2 were intact.
I know this is old but I had the same problem after deleting a driver associated with Hyper V and fixed it by uninstalling the virtual machine platform and Windows Hypervisor along with WSL, rebooted, reinstalled all 3 and then I could install Ubuntu again
This is my first answer on stack overflow and English is not my first language.
So, I will answer this question in images. My solution would not delete the date in any existing installed Linux distribution, at least for me.
Hope you can solve this problem successfully.
enter image description here
enter image description here
enter image description here
"Enable" Virtualization from your bios settings.
Settings may differ from bios to bios (search for your machine options)

Ubuntu 16.04 screen completely freezes only mouse moves

Ever since I have upgraded my laptop (Click here for hardware specs.) my screen usually freezes. Mostly in chrome or Firefox browser. I am pretty sure this is a Nvidia driver problem but I can't seem to find the solution. I am running a Nvidia Quadro K2100M.
I am currently running Nvidia 361.42. I have tried using open source Xorg server without any luck.
The only solution I have found so far is forcefully turning off the computer by holding down the power button.
Things that I have tried:
I got keyboard input
I cannot switch to another terminal to restart lightdm
This problem came to me occasionally, making me really annoyed.
As illustrated in many blogs, this may be caused by graphic driver problem. For me, my desktop has a NVIDIA video card, you can run lspci | grep VGA to see what type of your video type, in my case, it returned:
02:00.0 VGA compatible controller: NVIDIA Corporation G98 [GeForce 8400 GS Rev. 2] (rev a1)
I followed the instruction on jiakai zhang's blog to reinstall proper drivers for the desktop, hope this will help you.
The key steps in [1] are to reinstall the ubuntu desktop and nvidia drivier by:
$ sudo su
$ apt-get update
$ apt-get install --reinstall ubuntu-desktop
$ apt-get install unity
$ apt-get remove --purge nvidia*
$ reboot
$ sudo apt-get install nvidia-current
$ sudo reboot
Updating the grub settings worked for me! Do the following:
1. Open the GRUB configuration
sudo vi /etc/default/grub
2. Change the value of GRUB_CMDLINE_LINUX_DEFAULT from "quiet splash" to
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"
and save the file.
3. Update & Reboot
sudo update-grub
sudo reboot
More info:
This is a bug in the processor, known as the c-state bug. It causes total freezes when the CPU tries to enter an unsupported sleep state. It's a problem for many Bay Trail devices especially with newer (4.*) kernels. There is a simple workaround until it gets properly fixed upstream. You just need to pass a kernel boot parameter and the random freezing stops completely. The parameter may increase battery consumption slightly, but it will give you a usable system. You do this by editing the configuration file for GRUB as described above.
GRUB - boot loader package from the GNU Project, which provides a user the choice to boot one of multiple operating systems
installed on a computer or select a specific kernel configuration available on a particular operating system's partitions;
Intel Bay Trail - new Atom Processors from Intel. Atom is Intel's family of x86 and x86-64 processors that are optimized
for small computing devices, such as smartphones and mobile Internet devices;
C-States - used to optimize optimize or reduce power consumption in idle mode (i. e. when no code is executed) - (C0 to C8)
Reference: here.
I have since fixed this problem by re-installing Ubuntu 16.04 and not switching from the nouveau video driver. I also disable updates and everything been working good for about 2 months now.
Gaming is pretty good but I usually play steam games so doesn't push any kinda hard core graphics
Well, I had the same problem: My PC was freezing randomly. I tried Ubuntu 16, 17 and 18.04 and everything was the same. I tried several drivers and didn't get a solution. I tried several solutions that I found in the forums (including this) and got bad and harmful results.
My solution was: I stopped using the graphical nvidia card, removed it and now I'm using the integrated Intel HD graphics card (IntelĀ® HD Graphics 530 card (Skylake GT2)) and all the problems were solved!
I fixed mine using a few commands from #Qoros solution above. i just ran apt-get update, apt-get install nvidia-current, and sudo reboot. cheers to #Qoros btw!
For me, none of the approaches described in rest of the answers worked.
I was opening multiple terminal tabs running some heavy processes and ubuntu used to freeze when I had 6-7 tabs. I tried monitoring the resources used while I was starting my processes in terminal tabs. You can do it by opening System Monitor app and going to Resources tab.
What I noticed is that when my RAM(8GB) and my swap space(1GB) were completely used up, ubuntu would freeze.
As a solution, I increased my swap space and made it 16GB. After this memory never gets used completely and ubuntu doesn't freeze.
https://askubuntu.com/questions/178712/how-to-increase-swap-space decsibes how to increase swap space.

Setting up desktop environment on NetBSD 6.1.5

I have installed NetBSD 6.1.5 with full installation setting. However, when I run startx it says no screens could be found. So i tried "X -configure" and then "X -config ~/xconfig.conf.new" and I was brought to a very generic screen with a black x crosshair, but I was unable to exit this using the suggested ctrl+alt+backspace, so I had to force power off and check if my keyboard was recognized in the conf file generated, which it was. I have installed xdm, xterm, Xorg, and other X programs.
I am not familiar with setting up desktop environments from scratch. I am a newb who is used to Ubuntu esque installers doing that stuff for me.
Would someone be able to walk me though the installation or point me to a link which explains a step by step process?
What happens if you rename your xorg.conf.new to /etc/X11/xorg.conf? Does startx or xdm work then?
Are you running this inside a VirtualBox or other emulator?
I have NetBSD on a Thinkpad T420 which I occasionally boot into Windows, and I've setup VirtualBox to be able to run the same NetBSD install when I'm in Windows. The key difference in the xorg.conf file is in the Device section:
Section "Device"
Driver "vesa"
EndSection
Also I've found the free version of http://mobaxterm.mobatek.net/ very handy - I use it to ssh into the virtual NetBSD box and then run X apps and have them display on the Windows desktop.
Final note - you might want to look out for the NetBSD-7 RC1 which should be out 'Real Soon Now', as there are some very handy improvements, including better support for most modern display hardware :)
I found that running startx from any directory with a .xinitrc file gives strange behavior in amd64 6.1.5 and 6.1.4. Delete (or rename) any .xinitrc files and try
xinit /path/to/windowmanager
Please read Chapter 9 of NetBSD Guide:
http://www.netbsd.org/docs/guide/en/chap-x.html
Section 9.9 discusses installing various Desktop Managers/Environments.
It turns out that I could run "X -config xorg.conf.new" as root on host and then ssh using putty to manually launch windows.

Run linux distro of choice inside existing distro

Just wondering if it's possible and what the best route might be to run a full-on Linux distro within my existing distro? It would be great to for instance run Arch Linux within a chroot, jail, etc.. I believe people are doing this on Chromium for example.
I would require that whatever fs loaded, I can install packages using pacman and that my changes are kept intact.
I have tried the Virtualbox route by the way and there is a pretty nasty bug involving double mouse pointers on rotated host screens that I can't seem to get around.
I should mention that I'll be using this chroot environment for development, maybe running the odd X client to be exported remotely, etc..
I followed the chroot guide at https://wiki.archlinux.org/index.php/Change_Root and basically installed a whole Arch system within a nested chroot according to the Arch Linux installation guide and I'm now able to switch to the environment at will.
There is a tool https://github.com/fsquillace/junest that does everything automatically for you (downloads and unpacks ArchLinux distro inside some folder and chroots there).

Automate CentOS installation with VMware for testing

Is is possible to automate the installation of an OS using VMware or any other virtualization product?
One of our products consists of a customized version of CentOS that installs the OS and our application on a server. It's much like any CentOS/RHEL installation where you choose a mode that corresponds to different kickstart options, and then you choose your keyboard type. The rest of the installation is automatic.
What I'd like to have is an automated system that will create a new guest VM, boot it with the ISO image of our product, start the installation (including choosing the keyboard), wait for the reboot, and then launch a set of automated tests.
I know that there are plenty of ways to automate the creation of new VM guests from existing templates/images, and I know you can use the VIX API to interact with virtual machines, but the VIX API seems to require that VMware tools is already running (which won't be the case when you're booting from the CentOS install disk).
This answer (Automating VMWare or VirtualPC) indicates that you can script VMware to boot from an ISO that does an unattended installation, but I would really like to test the same process that our customers will be using.
Another option might be to use Xen's fully-virtualized mode and see if scripting it over the serial port will work.
TIA,
Jason
I have a very very similar question, it is on superuser:
https://superuser.com/questions/36047/moving-vmware-os-image-as-primary-os-on-a-system
You can also use VirtualBox instead of VMWare. The VirtualBox SDK allows you to directly control the keyboard, the mouse the serial port and the parallel port of the guest without the virtualbox guest tools installed.
Unfortunately it doesn't offer a text console interface but the serial port can be connected to a local pipe file and that can probably be worked with just as well.
This may not be exactly what you need:
I have done something similar with a Ubuntu-based install. We used preseeding (Debian's form of kickstart), to answer all the questions during the install - providing the preseed file and the installer via tftp.
In addition to the official Ubuntu mirror we added the apt-server with our own packages in the preseed file. We put a .deb version of vmware-tools on the apt-server and added it to the packages to be installed.
The .deb of vmware tools just contained the .tar.gz and a postinstall script that would extract it to /tmp and run the vmware install script (which has a switch to be run unnattended, so it does not ask any questions).
So after the reboot vmware-tools were up and running and we could use vix to script the rest (which was not very reliable).
If you should encounter problems with running vmware-config.pl during boot, you could make a custom package that just extracts the tools and an init script that installs them on first boot, disables itself and reboots.
Maybe you can use this strategy (replacing apt by yum, preseed by kickstart and tftp by a remastered iso). If you really need to test that your users choose a keyboard in the installer (which is not very different from kickstart) this would obviously not work for you..