Tags:
create new tag
view all tags

Virtualising an operating system.

I recommend installing the non-opensource version of VirtualBox since this is extremely easy to use, quick to set up, and comes with a whole host of set up options. This is entirely free (as in beer), and now has the ability to host 64 bit guests, and to allow those guests full 3D graphics acceleration.

Guest-Additions package

After installation of VirtualBox, use the main menus at the top of the window to install the guest-additions. To be honest, clicking "install Guest-Additions" does no such thing -- it merely mounts the iso as a CD image that you have access to from inside the virtual OS.

Once mounted, navigate to the cd mount point, and run the appropriate binary for your architecture. You should now have the ability to change to full screen, at full resolution, and to seamlessly move the mouse between the host and guest environments.

Shared folders

If you installed the guest-additions (see above), you should be able to mount a host folder as a shared folder inside the guest OS.

Use the VirtualBox menus ("devices" I think...) to set up a permanently shared folder. Once this is done, restart the virtual OS, and mount the folder at an appropriate location,

sudo mount -t vboxsf <shared_name> <mount_pt>

(Obviously replacing with the name you gave your shared folder, and with the location you want to mount it.)

Note that the filesystem "vboxsf" is not a typo. It is not supposed to be "vboxfs", even though that would make more sense!

Once this works correctly, you should edit /etc/fstab to include the appropriate options in order to allow write privs for your regular user.

Allowing SSH access to the virtual machine

Since the virtual machine uses Network Address Translation (NAT) to communicate with the Host's network (e.g. the internet), it will be disguised behind the host, thereby making it impossible to connect via ssh.

VirtualBox have very kindly provided a method to allow forwarding of ports from the host machine to the guest machine, which will allow connections to be made to this machine by connecting to the forwarded port of the host.

There are many tutorials out there that explain how to do this (e.g. this one), however this method needs a small tweak when the guest machine is Linux/Solaris.

Typing the following at the host command line (substituting for the name of your guest OS) will activate the port forwarding on host port 2222,

$ VBoxManage setextradata <guestname> "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/HostPort" 2222
$ VBoxManage setextradata <guestname> "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/GuestPort" 22
$ VBoxManage setextradata <guestname> "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/Protocol" TCP

Notice that the only real change from the tutorial linked to above is the name of the device (e1000 instead of pcnet).

After that, restart VirtualBox (not just the OS -- close and restart VirtualBox!), start the guest, and enjoy your ssh access to your virtualised machine with the following command,

ssh <name-of-host-computer> -p 2222

Note that one problem you may come up against is that the host key of the virtual machine will not match that of the host machine (which is the key that ssh will be expecting due to the previous command). This can be circumvented by temporarily commenting out the host's key in .ssh/known_hosts, logging onto the guest machine, and then removing the comment.

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions

Physics WebpagesRHUL WebpagesCampus Connect • Royal Holloway, University of London, Egham, Surrey TW20 0EX; Tel/Fax +44 (0)1784 434455/437520

Topic revision: r3 - 02 Jul 2009 - StephenMolloy

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback