Monday, April 18, 2016

Ubuntu Login Loop on VirtualBox

Today I had another headache and another quick fix, I wanted to document if someone else is also stuck on that annoying part.

If you're running a guest Ubuntu on a Windows host, and if you're also trying to do some graphics driver mambo-jambo, it is highly likely that your Ubuntu will not like it after a while (especially after you reboot or end session). It falls in a login loop, even though your credentials (and .Xauthority, and /tmp, and $HOME permissions) are fine, you cannot login in. For this case, none of the other solutions will work, and if you check your ~/.xsessionerrors, you'll see an error related to GLX.
Xlib:  extension "GLX" missing on display ":0".
That means there is something wrong with your nvidia driver and best to KILL THEM ALL! (Again, if you're on a vm... Else, I don't recommend it that easily :) ). I first tried removing nvidia-current, however if you search for more, you can see that there are even more nvidia packages installed (nvidia-304, seriously??!).
dpkg -l | grep "nvidia"
To search, use the above command, and to delete them all, use the following one:
sudo apt-get remove --purge nvidia-*   
sudo apt-get install ubuntu-desktop
If you haste to login right after the first one, you'll get the more annoying "low graphics" error. Because it also deletes the nvidia-commons package, so try installing ubuntu desktop again, then login. Everything should be fine!

(Note: To accomplish all those operations, you need to fall to the command line from the GUI. Use Ctrl+Alt+F1 for that, and login to your account.)

Thursday, March 10, 2016

A Simple VM with Ubuntu on Windows

Today we have yet another simple problem, and yet another simple solution. If you want to have a virtual machine with VirtualBox 5.0 on an Windows 7 host, and your guest Ubuntu 14.04 does not want you to do anything (literally, anything....) at start, such as:

  • "Read-only filesystem..."
  • "The system is running on low graphics mode..."
  • "Cannot find/install package X..."
  • Or, you are able to start the OS somehow but you're not allowed to do any package update/install.
Then you might have a disk space or memory issue. Although your VM might seem to have enough space, there are couple of things you can check:
  • Check your_vm->Settings->System->Motherboard, that you have enough RAM allocated.
  • Check your_vm->Settings->Storage->Controller->harddisk_name, that the destination it is mapped to (under Attributes, the little harddisk symbol) have enough actual disk space.
  • Again, at the same tab, check that the virtual size of the controller is more than ~4GB (a full ubuntu update would take ~3.5GB).
  • Finally, if none of the above works, re-partition your virtual disk at the ubuntu installation step. ~350MB swap area, ~5GB system folder, and ~4GB home folder would be minimums.
After that, Finally, if you're complaining about the visual performance and want more functionality (like, obviously, full-screen VM), then don't forget to install Guest Additions. For the above configuration I explained, Chapter 4.2.2 of this tutorial is helpful if not a little bit confusing. Note that if you don't solve the space issue in the first 3 items, then you won't be able to mount the VBoxLinuxAdditions.iso, so do not waste time poking the filesystem :)

I hope this helps someone to not waste time, just like I did!