Skip to content

Software installation: Adding a Ubuntu Virtual Machine in Windows

mvl22 edited this page Feb 19, 2012 · 1 revision

1. (Windows only) Install VirtualBox and an Ubuntu VM

We're using some clever geo software that doesn't yet run on Windows. Therefore there is no point trying to install Ruby on Rails on Windows, as you'll get to a stage where one key component simply won't work.

Therefore, the simplest thing is just to install a 'Virtual Machine' on Windows. It's actually reasonably straightforward and basically just gives you a Linux installation in a window in Windows.

As explained below, this still lets you use your favourite text editor, in Windows.

1a. Install VirtualBox

Basically, follow the instructions at: http://www.psychocats.net/ubuntu/virtualbox . These basically say:

  1. Download VirtualBox from http://www.virtualbox.org/wiki/Downloads
  2. Create a new Virtual Machine, calling it e.g. Ubuntu
  3. Allocate sufficient memory. My computer has 4GB of RAM, so I allocated 1GB to this VM.
  4. Create a new 'hard disk', making sure you use 'Fixed-size storage'. I created an 8GB hard disk.
  5. Click Finish and wait for it to install.

1b. Add Ubuntu as a Virtual Machine to VirtualBox

  1. Now go and get a copy of Ubuntu from http://www.ubuntu.com/download/ubuntu/download . Ubuntu 11.10 32bit is fine. This will give you a .iso (disk image) file, effectively a CD as a file.
  2. When your virtual machine is ready, click Settings > Storage > and next to the CD/DVD drive entry is a folder. Click on that and select the .iso file you downloaded.
  3. Start the Virtual Machine, which will create a new Window as if you're starting up a separate computer.
  4. Go through the normal setup procedure to install Ubuntu. Make sure you create a proper login rather than auto-login.

1c. Add a nicer desktop GUI (Gnome)

The default interface on Ubuntu 11.10 is a little unusual, so for a more user-friendly interface, install Gnome, as follows:

  1. Go to the applications area, and search for Terminal, and open that.
  2. Install Gnome using:
sudo apt-get install gnome-shell
  1. Reboot, by clicking on your username in the top-right, then Shutdown > Restart
  2. After the reboot, on the login window select Gnome classic, by clicking on the cog icon.
  3. Everything will now be much nicer!
  4. You can drag items from the Application menu in the top left down to the taskbar at the bottom, e.g. a web browser link, terminal and a text editor.
  5. Add any software you like, e.g. Chromium from the Ubuntu Software Centre

1d. Allow the Virtual Machine to read some of your Windows files (if you want).

If you want, you might want to store the files you create on your Windows machine (rather than 'inside' the Virtual Machine). Perhaps, for instance, you want to continue using your favourite Windows text editor or IDE to edit those files, even though the Ubuntu side will be 'running' them in the server-side software.

If you want to store your documents in your Windows files area, you can enable the Virtual Machine to see those files, as follows, by creating a 'shared' folder. This is done using the 'Guest Additions' feature of VirtualBox. An overview of this is at http://www.howtogeek.com/75705/access-shared-folders-in-a-virtualbox-ubuntu-11.04-virtual-machine/ , but basically in summary:

  1. In VirtualBox, when Ubuntu is running, go to Devices > Install Guest Additions and let this install.
  2. Add a shared folder using Devices > Shared Folders... I called my folder H (since I happy to use the H drive for my files), but call it what you wish.
  3. In Ubuntu, add your username to the list of users in the 'vboxsf' group. This is done in System > Administration > Users and Groups > [Ensure your user is selected] > Manage Groups > Properties > [Tick your user]
  4. Now, you should be able to access your shared folders in the /media/sf_Ubuntu_11.04 folder.
  5. To mount it at another location, e.g. I mounted my folder called H at the location /h/:
sudo mkdir /h
sudo mount -t vboxsf H /h

See: http://www.howtogeek.com/wiki/Mounting_a_Shared_VirtualBox_Folder_from_an_Ubuntu_Guest