miércoles, 13 de julio de 2011

virtualbox notes

Para los que no conozcáis virtualbox, es un software libre de virtualización que puede correr máquinas virtuales en windows, linux, Mac OS/X, ... puedes informarte sobre él o descargarlo en su página web. Yo lo suelo utilizar cuando me veo forzado a correr Windows y normalmente lo uso localmente, pero hoy he tenido que explorar su parte remota, accediendo a él desde otra máquina por escritorio remoto, estas son simplemente unas notas que he tomado.

For those of you who don't know virtualbox, it is a free(libre) virtualization software which can run virtual machines on windows, linux, Mac OS/X, ... you can learn about it or even download it on its home page. I typically use it when I'm forced to run Windows and I usually do it locally but today I had to explore its remote side, accessing to it via remote desktop, this are simply a couple of notes I took.

Start, headless, poweroff or save the virtual machine:

vboxmanage startvm vMachineName
vboxheadless -s vMachineName
vboxmanage controlvm vMachineName acpipowerbutton
vboxmanage controlvm vMachineName savestate

Control the rdp server (activate/deactivate/bind to localhost):

vboxmanage controlvm vMachineName vrde on
vboxmanage controlvm vMachineName vrde off
vboxmanage modifyvm vMachineName --vrdeaddress

Connect usb devices (list/connect):

vboxmanage list usbhost
vboxmanage controlvm vMachineName usbattach e13dc60f-4f3d-4e82-8a80-c05fca2e8

Connect through ssh to the server exporting the rdp port and then connect to the remote desktop:

ssh -X -L 3389:localhost:3389 RemoteHostName
rdesktop -k es localhost

2 comentarios:

Santiago García Mantiñán dijo...

I have stopped using the extension packs as we now have all I need on the standard free Debian setup, great :-)

I'm using vnc instead of rdp whenever I need to access remotely to the virtual machine.
For this I followed http://www.virtualbox.org/manual/ch09.html#otherextpacks
and did:
VBoxManage setproperty vrdeextpack VNC
VBoxManage modifyvm "VM name" --vrdeproperty VNCPassword=secret

It is working well for me.

Santiago García Mantiñán dijo...

Oh, BTW, the VNC server is launched on the 3389 port like if it was RDP.

Also there seem to be some problems with the young VNC plugin like crashes or that port seems to be listening after issuing a vboxmanage controlvm MachineName vrde off, ...

To avoid all this all I do is enable the vrde when the machine is not yet running (in saved state it works ok), then run the virtual machine and then save/powerOff and disable the vrde.