Virtualbox NAT ssh to guest

 

http://kdl.nobugware.com/post/2009/02/17/virtualbox-nat-ssh-guest/

Virtualbox NAT ssh to guest

By AkH , 1 year, 1 month ago,

In NAT mode (the default one), virtualbox does not give you the possibility to directly connect to your guest os.

Here is how to configure your Virtualbox to simply ssh myguest

For example my guest is called "Solaris10u6", configured to used e1000 card, the default in solaris configuration, (The host os is a Mac).

Type this command in terminal:

VBoxManage setextradata Solaris10u6  "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/Protocol" TCP
VBoxManage setextradata Solaris10u6  "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/GuestPort" 22
VBoxManage setextradata Solaris10u6  "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/HostPort" 2222

It stands for redirect all connection to TCP port 2222 from the host os (my mac) to the port 22 of the guest (my solaris).

To connect to your Virtual machine guest simply do ssh -p 2222 localhost and you are in.

If you want to check all the config applied to a guest type in terminal:

VBoxManage getextradata Solaris10u6 enumerate

By the way if you get this kind of errors:

Configuration error: Failed to get the "MAC" value (VERR_CFGM_VALUE_NOT_FOUND).

It means you have set the config to a network adapter which is not the one used by your guest for example, this wil raise an error when you will start the vm if you are using a e1000 adapter:

VBoxManage setextradata Solaris10u6  "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TC

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值