It’s Sunday afternoon and Deb is feeling poorly…but not so poorly that she’s not offering considerable editorial input into this post. In between the sniffles and requests for lemsip etc…she’s throwing in various comments relating to various icons from the sci-fi genre. To be fair, I have borrowed her laptop as it’s the only one in the house running Windows 7.
I will attempt to minimize the in-jokes and references but I thought I’d better go on record and report the fact that I am under some duress here. Honestly, some people are soooo geeky !
What I want to do in this post is to go through :
- setting up VirtualBox and running Ubuntu as a guest os
- getting the Guest desktop to display in a full screen
- getting the Number Keypad to work in the VM
- setting up a directory so that files can be shared between guest and host
The Three Laws
Just a quick note about terminology.
Host – is the Windows 7 OS that we’re going to install all this stuff on
Guest – is the Ubuntu machine that we’re going to be running in the Virtual Machine
To boldly go…
The first steps in our brave new (virtual) world ( don’t worry, she’s got to go to the loo sometime), is to install the Oracle VirtualBox VM. You can get it from here.
Next, we need to get a copy of Ubuntu. Best bet is to use the latest Long-Term Support version ( currently Ubuntu 10.04.2) from here.
Just follow the wizard steps to install VirtualBox.
When you configure the new VM through the wizard, select the appropriate Operating System ( in this case, Linux) and Version (Ubuntu) then accept all of the other defaults for now.
When you actually start the new VM for the first time, you’ll be presented with the First Run Wizard. Moving swiftly on ( before Deb gets in with any Harry Potter references), you’ll get a screen asking you to Select Installation Media.
Just select the Ubuntu iso you downloaded earlier.
Once you get Ubuntu desktop up, then click the install icon on the desktop. Note – at this point, you’re Numeric Keypad will not be working. We’ll fix this a bit later, but for now, you need to use the number keys above the letters on your keyboard.
Once you’ve done this, you need to make sure that the virtual cd/dvd is removed from the virtual cd/dvd drive before you virtually re-start the virtual machine. Hmmm, no response. Somehow I think she may not have seen Tron.
Anyway, the easiest way to do this is to go to the VirtualBox Devices Menu, select CD/DVD Devices / Remove Disk From Virtual Drive
When you reboot, you should now be running the installed version of Ubuntu and not just the live CD image in the VM.
We can rebuild him….
Moving swiftly on from Deb’s musings on the subject of exactly which bits of Steve Austin were bionic, the next step is to install Guest Additions in Ubuntu.
Before doing this it’s a good idea to run Update Manager in the Ubuntu guest ( System / Administration / Update Manager). This is because, if you have a linux kernel update, it does tend to mess up the Guest Additions installation and require a re-install.
With Ubuntu up and running in the VM, go to the VirtualBox Devices Menu and select Install Guest Additions.
This should load a CD into the virtual drive. You then need to navigate to the cd in Nautilus ( Places / Computer/ CD/DVD Drive) and then click autorun.sh. When prompted, just click the Run button.
Once the installation is complete, do a shutdown of the virtual machine ( removing the virtual CD/DVD first).
I canna change the laws o’ physics
However, we can now start to address some of the issues with which we are currently faced.
First up is getting the Ubuntu Guest to display fill-size in fullscreen mode. This is especially useful if you happen to have two monitors at your disposal as you’ll be able to use one for the host and one for the guest.
With Ubuntu shut down, amend the Display settings for the VM in VirtualBox. The Video Memory should be set to 64MB and the Enable 3D Acceleration checked.
Now, when you go into the Ubuntu System Menu and select Preferences / Monitor, Ubuntu should recognize the monitor type VBX. Additionally, you’ll also be able to increase the resolution to something in-line with what’s running on the host.
Once these changes have been made, switching the VM to fullscreen mode ( VirtualBox Menu, Machine / Fullscreen) should now result in the desktop taking up all of the available real-estate.
The Numeric Keypad can also be enabled by means of settings in the Ubuntu System/Preferences Menu. This time, go to Keyboard.
First of all, in the Mouse Keys tab, uncheck Pointer can be controlled using the keypad.
Secondly, in the Layouts tab, click Options… and under Numeric Keypad Layout Selection check Legacy. The Number pad should now work.
Although the clipboard is set to be bi-directional by default, it would seem that, with the Win7 host / Ubuntu guest combination at least, you can only cut and paste from the Host to the Guest and not the other way around.
You can, however, set one or more host directories to be visible to the guest OS and use this as a means of transferring files between the two.
First, we need to create the shared folder in windows ( I slapped mine on my Windows Desktop). Let’s assume it’s called vShare.
Now we need to set it up in Virtual Box. So, with the Ubuntu VM powered down, go into Settings / Shared Folders. Select the folder you want to use as the share and click OK. Note – you shouldn’t check either the Read-Only or Auto-Mount boxes. Also, avoid underscores in the folder name as these don’t seem to work too well for some reason.
Now, when you start the Ubuntu guest again, you need to mount the share ( note that the mount-point name in the guest needs to be different from the name of the shared folder on the host) :
$ sudo mkdir /mnt/hostShare $ sudo chmod 777 /mnt/hostShare $ sudo /sbin/mount.vboxsf –w vShare /mnt/hostShare
Note that if you’ve chosen a different name for your shared folder, use the name of the folder that’s shown in the VirtualBox Devices / Shared Folders dialog box.
To get the share to load everytime you startup the Guest os, you need to edit /etc/rc.local and add the following line :
/sbin/mount.vboxsf -w vShare /mnt/hostShare
To make it easier to get to from within the host, you can put a symbolic link on the desktop :
$ ln –s /mnt/hostShare $HOME/Desktop/host_share
A folder called host_share should now appear ( or materialize, if you prefer, ) on your Ubuntu desktop.
Escaping the Mirror Universe
By now, you will have noticed that, by default, Ubuntu has it’s Window control buttons on the left of the Window title bar rather than the right. If this is starting to get on your nerves…
On the Ubuntu Desktop, hit Alt + F2.
In the Run Application box that appears , type in gconf-editor and hit Run.
In the tree menu in the left-hand pane now navigate to apps/metacity/general
Right-click button_layout in the right-hand pane then click Edit Key.
Change the settings to menu:maximize,minimize,close
The buttons should now magically have switched sides.
The Final Frontier
As I’ve nearly exhausted Deb’s supply of Star Trek references, I’ll leave you with this thought :
Klingon programs do not have parameters, they have arguments…and they ALWAYS WIN THEM !