I have virtualbox running on a Windows 2008 server, with a guest running ubuntu 10.04. The ubuntu guest is given a static IP of 192.168.1.4, which also has openssh installed. The guest has bridged network setup, I can ping 192.168.1.4 from any machine in the LAN, the ubuntu guest can also access the LAN. However, when I try to PuTTY into the ubuntu machine, I always get "connection refused". Below are some setup details:

ubuntu IP: 192.168.1.4

hosts.allow

sshd : 192.168.1.38

hosts.deny

ALL : ALL

when I the following command, I can see that sshd is listening on port 22:

lsof -i tcp:22

Any idea?

EDIT:

It turned out to be a wrong VirtualBox Bridged Network setup. I give the Ubuntu guest a static IP of 192.168.1.4 (assigned to eth0). Then in the Windows 7 host, in the Network and Sharing Center, there is a new connection named "VirtualBox Host-Only Network" after the bridge is setup, that connection is again given the same static IP of 192.168.1.4. Once I change the "VirtualBox Host-Only Network" to automatically obtain an IP address, it's getting a different IP address of 169.254.249.70(Tentative). And now I can SSH into 192.168.1.4 with no problem, even without touching hosts.allow and hosts.deny.

I've also noticed that in the properties windows (see screenshot below) of the "VirtualBox Host-Only Network", the second checkbox, "VirtualBox Bridged Networking Driver" is unchecked. While the same checkbox of the physical NIC (that is bridged to) is checked. So my further question is: is this how VBox bridged networking supposed to be setup? Any rationale behind this? I'd appreciate if someone could provide some explaination on VBox bridged networking setup on Windows host and I'll accept it as an answer.

VirtualBox Host-Only Network Properties

link|improve this question

25% accept rate
What network config is Vbox using? – Amith KK Feb 8 at 6:20
Have you check firewall? – Carlos Fernández San Millán Feb 8 at 6:23
Is there a firewall / windows firewall on the host machine installed / enabled? I am not sure where in the driver stack the network bridge is settled and whether it completely bypasses the firewalls on the host computer. Can you access the virtual ubuntu machine directly from the host pc? – Michael K Feb 8 at 6:24
for VirtualBox and its network to work properly both vboxdrv vboxnetflt modules must be running. Can you confirm it? – Carlos Fernández San Millán Feb 8 at 6:29
1  
If you are in a laptop check which adapter you have chosen as default and which you are using in windows. For example, if you are on a desktop without wifi, then you should choose eth0 by default in VBox. If you are on a wireless connection, make sure you have selected wlan0. – Carlos Fernández San Millán Feb 8 at 7:17
show 8 more comments
feedback

1 Answer

I have a Windows 7 host, Ubuntu 12.04 guest, Virtual Box.

My host get the IP from a router via wireless, choose network adapter options (running Ubuntu ) and select ''Attached to bridge adapter -> Name: < the name of your connection adapter (it can be your wireless or network adapter) >.

Disconnect the ''wired connection'' from Ubuntu and set as DCHP client (automatic DHCP) in edit connections ipv4.

Now you get an Ip assigned by your router and you can test making ping between host -> guest and guest -> host.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.