RabbieBurns (2nd July 2009)

How would I go about installing virtualbox or vmware so I can run a virtual Windows XP / Server2008 on a gentoo server which doesnt run X, and that I have only SSH/FTP access to.
Is it possible??

Hi Robert,
So you get a version of VBox from this century
Once that's installed, run the following commands to create the vm.echo "app-emulation/virtualbox-bin" >> /etc/portage/package.keywords
echo "app-emulation/virtualbox-modules" >> /etc/portage /package.keywords
emerge virtualbox-bin
Run this to start the virtual machineVBoxManage createvm -name "Test" -register
VBoxManage modifyvm "Test" -memory "256MB" -acpi on -boot1 dvd -nic1 nat
VBoxManage createvdi -filename "Test.vdi" -size 1000 -register
VBoxManage modifyvm "Test" -hda "Test.vdi"
VBoxManage registerimage dvd /root/install-x86-minimal-20090623.iso
VBoxManage modifyvm "Test" -dvd /root/install-x86-minimal-20090623.iso
It'll be listening on port 3389 for an RDP Client unless you change this port in the VBoxHeadless command above.VBoxHeadless -startvm "Test"
I note you mention you only have SSH/SFTP access, I figure you could tunnel this over SSH or have a port opened or so but I've tested this out to run an installation of Gentoo internally in itself and it seems to work fine.
Worth a go.
RabbieBurns (2nd July 2009)

Thanks so much for that! Ive got openvpn setup now so am pretty much local now. Ill get right on trying this out.
Thanks again for all that time and effort.

No problem, it was something I needed to do anyway so it served a dual purpose.
Let me know how you get on![]()

OK so for the interest of everyone else thats gonna be doing this ill paste a detailed account of the stages.
So i figure I needed the libsdl package installed...Code:oasis ~ # emerge -av virtualbox-bin These are the packages that would be merged, in order: Calculating dependencies... done! emerge: there are no ebuilds built with USE flags to satisfy "media-libs/libsdl[X]". !!! One of the following packages is required to complete your request: - media-libs/libsdl-1.2.13-r1 (Change USE: +X) (dependency required by "app-emulation/virtualbox-bin-2.2.4" [ebuild]) (dependency required by "virtualbox-bin" [argument])
Once thats installed, I try to emerge vbox again..Code:oasis ~ # emerge -av libsdl These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild N ] media-libs/libsdl-1.2.13-r1 USE="alsa audio esd joystick oss video xv -X -aalib -arts -custom-cflags -dga -directfb -fbcon -ggi -libcaca -nas -opengl -pulseaudio (-svga) -xinerama" 3,295 kB Total: 1 package (1 new), Size of downloads: 3,295 kB
Failed again, so I look closer and i see the Change USE: +X line..Code:oasis ~ # emerge -av virtualbox-bin These are the packages that would be merged, in order: Calculating dependencies... done! emerge: there are no ebuilds built with USE flags to satisfy "media-libs/libsdl[X]". !!! One of the following packages is required to complete your request: - media-libs/libsdl-1.2.13-r1 (Change USE: +X) (dependency required by "app-emulation/virtualbox-bin-2.2.4" [ebuild]) (dependency required by "virtualbox-bin" [argument])
Am i right in thinking I need to change my make.conf to incluse USE +X and then remerge libsdl?

OK, so I changed /etc/make.conf to have USE=X rather than USE= -X
So I install that again... and then try to emerge virtual box:Code:oasis ~ # emerge -av libsdl These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] media-libs/libsdl-1.2.13-r1 USE="X* alsa audio esd joystick oss video xv -aalib -arts -custom-cflags -dga -directfb -fbcon -ggi -libcaca -nas -opengl -pulseaudio (-svga) -xinerama" 0 kB Total: 1 package (1 reinstall), Size of downloads: 0 kB Would you like to merge these packages? [Yes/No]
So far So good...Code:oasis ~ # emerge -av virtualbox-bin These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild N ] media-libs/libmng-1.0.10 USE="-lcms" 1,068 kB [ebuild N ] app-emulation/virtualbox-modules-2.2.4 470 kB [ebuild N ] app-emulation/virtualbox-bin-2.2.4 USE="additions chm -headless -sdk -vboxwebsrv" 44,399 kB Total: 3 packages (3 new), Size of downloads: 45,937 kB Would you like to merge these packages? [Yes/No]

Once thats done I scroll up to see if theres any important messages, and take note of them just in case..
Code:* To launch VirtualBox just type: "VirtualBox" * * You must be in the vboxusers group to use VirtualBox. * * For advanced networking setups you should emerge: * net-misc/bridge-utils and sys-apps/usermode-utilitiesOnwards we go..Code:* Starting with the 2.1 release a new kernel module was added, * be sure to load all the needed modules. * * Please add "vboxdrv" and "vboxnetflt" to: * /etc/modules.autoload.d/kernel-2.6

Code:oasis ~ # VBoxManage createvm -name "Test" -register VirtualBox Command Line Management Interface Version 2.0.2 (C) 2005-2008 Sun Microsystems, Inc. All rights reserved. Virtual machine 'Test' is created and registered. UUID: 34187ba8-7f1a-4db6-92f8-cf445f3259b9 Settings file: '/root/.VirtualBox/Machines/Test/Test.xml'Code:oasis ~ # VBoxManage modifyvm "Test" -memory "256MB" -acpi on -boot1 dvd -nic1 nat VirtualBox Command Line Management Interface Version 2.0.2 (C) 2005-2008 Sun Microsystems, Inc. All rights reserved.Code:oasis ~ # VBoxManage createvdi -filename "Test.vdi" -size 1000 -register VirtualBox Command Line Management Interface Version 2.0.2 (C) 2005-2008 Sun Microsystems, Inc. All rights reserved. Disk image created. UUID: c130be56-b0f2-4c2a-829d-c37b92f5cde3Code:oasis ~ # VBoxManage modifyvm "Test" -hda "Test.vdi" VirtualBox Command Line Management Interface Version 2.0.2 (C) 2005-2008 Sun Microsystems, Inc. All rights reserved.Well, I dont have that ISO in that location, so that was obvious it was going to fail... Ill try my Windows 2003 Server image Ive just made.Code:oasis ~ # VBoxManage registerimage dvd /root/install-x86-minimal-20090623.iso VirtualBox Command Line Management Interface Version 2.0.2 (C) 2005-2008 Sun Microsystems, Inc. All rights reserved. [!] FAILED calling virtualBox->OpenDVDImage(filepath, Guid(), dvdImage.asOutParam()) at line 6661! [!] Primary RC = NS_ERROR_FAILURE (0x80004005) - Operation failed [!] Full error info present: true , basic error info present: true [!] Result Code = NS_ERROR_FAILURE (0x80004005) - Operation failed [!] Text = Could not open the CD/DVD image '/root/install-x86-minimal-20090623.iso' (VERR_FILE_NOT_FOUND) [!] Component = DVDImage, Interface: IDVDImage, {140fff03-e479-4194-8562-abc4f8171009} [!] Callee = IVirtualBox, {557a07bc-e6ae-4520-a361-4a8493199137}
Code:oasis ~ # wget http://192.168.2.4/win2003serv.iso --2009-07-02 18:08:16-- http://192.168.2.4/win2003serv.iso Connecting to 192.168.2.4:80... connected. HTTP request sent, awaiting response... 200 OK Length: 596588544 (569M) [application/x-iso9660-image] Saving to: `win2003serv.iso' 100%[=============================================================================================================================>] 596,588,544 11.2M/s in 51s 2009-07-02 18:09:07 (11.2 MB/s) - `win2003serv.iso' saved [596588544/596588544]Code:oasis ~ # VBoxManage registerimage dvd /root/win2003serv.iso VirtualBox Command Line Management Interface Version 2.0.2 (C) 2005-2008 Sun Microsystems, Inc. All rights reserved.So far so good.. now to test if it runs...Code:oasis ~ # VBoxManage modifyvm "Test" -dvd /root/win2003serv.iso VirtualBox Command Line Management Interface Version 2.0.2 (C) 2005-2008 Sun Microsystems, Inc. All rights reserved.

No errors. But I cant seem to get my ubuntu RDP to connect to it. Ill try in my XP VM.Code:oasis ~ # VBoxHeadless -startvm "Test" VirtualBox Headless Interface 2.0.2 (C) 2008 Sun Microsystems, Inc. All rights reserved Listening on port 3389
And here it is in all its glory. Windows XP Virtual Machine, running on an Ubuntu Host, connecting over VPN, to a Gentoo server, running a virtual Windows 2003 Server setup.
NICE. Many thanks to kmount.
![]()

A pleasure Robert.

Is this worth turning into a wiki does anyone think? I might add that I used x64 gentoo, so it works for both.

couple of additional questions... im running the VBoxHeadless -startvm "Test" command in screen just now, so i can detatch from the terminal and leave it running.. is there any way to run it as a daemon, or even set it to run on startup? And also, Ive got 2003 serv up and running, sitting at the logon screen, how can i send a crtl-alt-del over rdp?

You can push it into the background by putting & after the command which should suffice.
Quick script to check whether it's running and if not could be the following. (Written kind of from memory so would be worth testing!)
VBoxManage -q list runningvms | grep "Test" || (VBoxHeadless -startvm "Test" &)
Depending upon what rdp client you're using, you should be able to set up a hotkey to push CTRL/ALT/DEL across or try CTRL ALT INSERT first.
RabbieBurns (4th July 2009)

@RabbieBurns: Di you try (Righthand)Ctrl+Del? This is the default shortcut to send Ctrl+Alt+Del in VirtualBox.
Please do post on the wiki too... or ask EduTech or FN-GM REALLY nicely for a hand![]()
RabbieBurns (4th July 2009)

ctrl-alt-ins worked on xp remote desktop, but in ubuntu I cant get anything working.
Do I need to install the virtualbox-toolbox thing as well for the client os so I can get proper resolution?
There are currently 1 users browsing this thread. (0 members and 1 guests)