Setting Up Tunneling With a VirtualBox Guest Machine
I regularly use VirtualBox, which allows you to set up and run virtual machines (VMs) on your own desktop. It's a very nifty bit of software, but one drawback is that by default, the guest VM is invisible to the host or any other machines on the network. You can't, for example, access the Web server on your guest from the host.Tip of the Trade: VirtualBox makes it easy to set up and run virtual machines on your own desktop. It is not perfect, however, and by default, the guest VM is invisible to the host or any other machines on the network. Here's an easy way to relay instructions to it.
Happily, there is a way of proxying specific connections, using the VBoxManage tool. To forward ssh on one guest, I used the following commands:
VBoxManage setextradata "Debian Lenny" " VBoxInternal/Devices/pcnet/0/LUN#0/Config/virtualssh/Protocol" "TCP"VBoxManage setextradata " Debian Lenny" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/virtualssh /HostPort" 5000 VBoxManage setextradata "Debian Lenny" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/virtualssh/GuestPort" 22
A couple of notes: Firstly, the guest must be switched off when you issue the commands. Secondly, presumably for security reasons, the forwarding doesn't appear to last between iterations of VirtualBox – each time you quit VirtualBox, you'll need to reissue the commands when you start it back up again. If you're doing this regularly, you'll want to put the lines above into a shell script and run that when required.
Juliet Kemp has been messing around with Linux systems, for financial reward and otherwise, for about a decade. She is also the author of "Linux System Administration Recipes: A Problem-Solution Approach" (Apress, 2009).
IT Solutions Builder TOP IT RESOURCES TO MOVE YOUR BUSINESS FORWARD
Which topic are you interested in?
What is your company size?
What is your job title?
What is your job function?
Searching our resource database to find your matches...