User Tools

Site Tools


docs:tips_n_tricks:virtualbox.html

Virtualbox

Mac OS X Host

Download virtualbox for personal use from Virtualbox.org

Debian Etch/Lenny Guest

(this is from memory - real package names and options may vary)
If you apply this to an Etch system, you have to upgrade some X11 components and base libraries (libc, locales, …) to Lenny before.

Add to /etc/apt/sources.list:

deb     http://www.backports.org/debian/  lenny-backports main contrib non-free

and run apt-get update.
Next make sure /lib/modules/`uname -r`/build points to your current kernel sources and run:

apt-get install virtualbox-ose-guest-utils
apt-get install virtualbox-ose-guest-x11
# apt-get install virtualbox-ose-guest-modules-2.6 # (maybe not?)
apt-get install virtualbox-ose-guest-dkms

In case something went wrong, redo module compilation by

dpkg-reconfigure virtualbox-ose-guest-dkms

Unload and load modules:

/etc/init.d/vboxdrv stop # if for any reason you had a host setup
                         # configured in your guest
/etc/init.d/virtualbox-guest-addons start

create xorg.conf with

X -configure
# (I had to ln -s /dev/input/mouse1 /dev/mouse)
# test
X -config /root/xorg.conf.test

and deploy it:

mv -iv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
mv -iv /root/xorg.conf.test /etc/X11/xorg.vbox.conf
ln /etc/X11/xorg.vbox.conf /etc/X11/vbox.conf
/etc/init.d/gdm restart

In X11, enable root to act with the X11 system (set DISPLAY and authorize by xhost or xauth - whatever you prefer) and engage guest integration by

VBoxClient --display
VBoxClient --seamless
VBoxClient --clipboard

You might want to automize the latter for future logins.

Command Line

Start a headless VM

(saved and stopped machines)

VBoxHeadless --startvm <vmname> [-vrde on]

Save/resume a VM

VBoxManage controlvm <vmname> pause|resume|reset|poweroff|savestate

(to resome saved machines see above)

Connect to headless machine by RDP

assuming, you're using a german keyboard:

rdesktop -k de localhost 

(Provided the VM is running on your local machine and VBoxHeadless told you VRDE server is listening on port 3389)

rc.vbox

This is some very basic start-stop script suited more to support your memory then to be used as a init.d script …

#!/bin/sh

vm="${2:-MyDefaultVM}"

case "$1" in
"start")       VBoxHeadless --startvm "$vm" -vrde on & ;;
"show"|"view") /opt/local/bin/rdesktop -k de localhost   ;;
"stop")        VBoxManage controlvm "$vm" savestate    ;;
*)             echo "Usage: ${0##*/} start|stop|show" >&1 ; exit 42 ;;
esac

Credits:

Information from here and from my experience.

docs/tips_n_tricks/virtualbox.html.txt · Last modified: 07.07.2012 15:46 CEST by peter