By default SSH & ping between Virtualbox Guest and Host is disabled. Virtualbox make NAT connection between Host and Guest so we can have internet connection in Guest. To make Host and Guest can communicate in two ways, here are the steps : 1. Create vboxnet0 network device. Add host-only by press + (plus) button. 2. Create new Network adapter in Guest 3. Start your Guest 192.168.56.101 is your Guest IP. If eth1 doesn’t have any IP, then we should assign static IP by edit “/etc/network/interfaces” And reboot your Guest. After reboot, check your IP again. 4. For easy mouse and keyboard switch between Guest & Host출처 : http://wpscale.com/how-to-ping-and-ssh-ubuntu-guest-host-virtualbox/
How to SSH from CentOS to Ubuntu Guest Host Virtualbox
If you don’t have this vboxnet, you will have empty in Network Adapter preferences.
So, open Virtualbox and go ” File -> Preferences -> Network “.
Right-click into your Guest Virtualbox, select “Settings”. Go to “Network -> Adapter2″.
Attached into host-only adapter and select name into vboxnet0.
In mine, I use Ubuntu as Guest & Host OS. So, in after login into Guest, you should check if host-only adapter works or not. Do “sudo ifconfig eth1″ :
2
3
4
5
6
7
8
inet addr:192.168.56.101 Bcast:192.168.56.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe97:1c69/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1684 (1.6 KB) TX bytes:9659 (9.6 KB)
Now on host, you can do ssh ubuntu@192.168.56.101.
2
3
4
iface eth1 inet static
address 192.168.56.101
netmask 255.255.255.0
Run your Virtualbox Guest machine. On menu Devices, select install guest additions.
WRITTEN BY
- RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.