Saturday, May 29, 2010

Example of SSH tunneling

Example:
ssh -N -L 5904:127.0.0.1:5901 username@remoteserverThe above command forwards everything on localhost port 5904 to the port 5901 on remoteserver. This is what I use to connect to a VNC service on port 5901 on a remoteserver at my job from my home computer. Thus, at home, after establishing the above tunnel I can use a vncviewer as follows:vncviewer :4

Friday, May 14, 2010

VirtualBox: start and stop a guest in a headless mode

Lets assume that we have a guest VirtualBox machine called "xp". To start it in a headless mode we can use VBoxHeadless --startvm "xp"To stop it we can use VBoxManage controlvm "xp" savestateSince it is in a headless state we have to access it using a RDP viewer, e.g. rdesktop command in Linux:desktop -u username -p password -a 16 serverIPOf course, before we can use it in this way, we have to enable remote destkop for the "xp" machine and define authentication method. In my case, I used External method, since it uses the linux user account under which my VirtualBox is running.