/ Linux

Linux in VirtualBox on Windows

I recently got a new computer with Windows 8 installed. I will be using it mainly for web development. I setup a VirtualBox with Ubuntu. It's more or less a piece of cake, but I thought I'd summarize what I did.


In my case security is of high priority. It is very important that no information on the computer is leaked. I choose to use TrueCrypt and create a virtual encrypted disk to hold all important files. Including VirtualBox disks.

The password for decrypting the filesystem is the only protection that I have. Ubuntu will automatically logon a user that can do sudo without supplying password.


TrueCrypt is available here. Creating the encrypted filesystem is easy, just click Create Volume and choose create an encrypted file container. A neat feature is to have it mounted on Windows startup, you can do that if you add the filesystem as a favorite.

Add Favorite
And check the option Mount selected volume upon logon.
Mount on logon


Download VirtualBox here. You may download latest bootable DVD from Ubuntu website but its much easier to grab an installation and then tweak it. You will find the latest Ubuntu here (In my case Ubuntu Linux 13.04 x86).

I hade to disable USB for the virtual macine to start.
Disable USB
To get Internet access, I added an NAT adapter like this:

As I was unable to reach running servers on the virtual machine from the physical machine, I added another Host-only adapter. This will allow you to run, for example, a web server on the virtual machine and surf in to it from the physical machine.
Network adapter 2
Note that the Adapter 1 shown in these scrennshots should be disconnected or not there at all.

Ubuntu tweaks

To allow user ubuntu to do sudo, without specifying a password, do this.

sudo nano -w /etc/sudoers.d/ubuntu 

And add this.


I would recommend using LXDE window manager, its much more lightweight compared to Unity.

sudo apt-get install lxde

To use it, logout and login again but this time select LXDE on login screen.

To have user ubuntu login automatically do this.

sudo apt-get install gnome-system-tools

In LXDE menu, go to preferences / users and groups.
Select checkbox Dont ask for password on login.
User settings

To disable screensaver go to preferences / screensaver and select mode Disable Screensaver