CahBojonegoro

Rawe Rawe Rantas, Malang Malang Putung

Accessing VBox Guest OS from Host OS

with 3 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

Note:
– 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

3 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: http://voxseo.com/traffic/ 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.

    Valencia

    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.

    kind

    October 2, 2014 at 3:07 am

  3. The idea behind it is in line with the success of the that have achieved their
    objectives through commitment, conviction and persistence.

    Eleanore

    October 29, 2018 at 10:37 am


Leave a comment