Rawe Rawe Rantas, Malang Malang Putung

Accessing VBox Guest OS from Host OS

with 2 comments

This is a reverse method from the previous post.
If in the previous post, we able to access Host OS root directory from Guest OS ( inside Virtual Box), now we are trying the opposite way. Yes, we will access Guest OS root directory from Host OS, using the same tool, ssh.

First, Guest OS should be able to receive ssh. For Linux guest OS, you can install openssh-server.
Then, Guest OS should be able to be receive ssh from outside world or at least from Host OS. In Virtual Box we can use Host Interface Networking or NAT with Port Forwarding.
Since Host Interface Networking is a bit complicated, we will use NAT then enable port forwarding for ssh only.

Here are the steps:

1. Shutdown your VM.
2. Setup ssh port forwarding on host OS.

VBoxManage setextradata GuestOSname “VBoxInternal/Devices/pcnet/0/LUN#0/Config/SSH/HostPort” 2222
VBoxManage setextradata GuestOSname “VBoxInternal/Devices/pcnet/0/LUN#0/Config/SSH/GuestPort” 22
VBoxManage setextradata GuestOSname “VBoxInternal/Devices/pcnet/0/LUN#0/Config/SSH/Protocol” TCP

– This will setup ssh port forwarding from port 2222 on Host OS to port 22 in Guest OS.
– Network adapter in VM Setting should be set to PCnet , if not there will be error and VM can’t boot.

3. Start Guest OS Virtual Machine.
4. Check that ssh port forwarding is successful. try to ssh from Host OS to Guest OS.

ssh -p 2222 UsernameGuestOS@localhost

5. I guest you already know what is the next step 🙂
Yes, we just need to use sftp from Nautilus.

Go to Places -> Connect to Server
Then Service Type = ssh
Server = localhost
UserName = GuestOS-UserName
Mark Add Bookmark if you want to add it in Nautilus Bookmark.

Then, we already can access our VM root directory from Host OS.
In case you want to remove ssh port forwarding, these are the commands.

VBoxManage setextradata GuestOSname “VBoxInternal/Devices/pcnet/0/LUN#0/Config/SSH/HostPort”
VBoxManage setextradata GuestOSname “VBoxInternal/Devices/pcnet/0/LUN#0/Config/SSH/GuestPort”
VBoxManage setextradata GuestOSname “VBoxInternal/Devices/pcnet/0/LUN#0/Config/SSH/Protocol”

And, to verify whether a certain VM has port forwarding activated or not.

VBoxManage getextradata GuestOSname

OK then, back to work 🙂


Written by cahbojonegoro

December 24, 2008 at 4:47 pm

Posted in Ubuntu

2 Responses

Subscribe to comments with RSS.

  1. This is a message to the webmaster. Your website is missing out on at least 300 visitors per day. I have found a company which offers to dramatically increase your traffic to your website: They offer 1,000 free visitors during their free trial period and I managed to get over 30,000 visitors per month using their services, you could also get lot more targeted visitors than you have now. Hope this helps 🙂 Take care.


    April 10, 2013 at 5:40 am

  2. I have read so many articles regarding the blogger lovers
    except this paragraph is genuinely a fastidious post, keep it up.


    October 2, 2014 at 3:07 am

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: