My host computer is OS X Snow Leopard and is connected to the network via Ethernet. The guest virtual machine is Ubuntu 12.04

My goal is for my virtual machine to behave like any other machine on the LAN. Specifically, I want to be able to SSH to and from the virtual machine and all the other machines on the network.

I thought of two solutions, but I haven't been able to get either solution to work.

Solution #1:

A virtual machine with a bridged adapter should behave like a normal machine on the LAN, so I set the adapter 1 for the virtual machine to bridged and selected en0 (ethernet) for the name. I then turned on the virtual machine and found I did not have any Internet access, so I couldn't install OpenSSH Server. To fix this I added a NAT adapter (adapter 2) so that I could install OpenSSH. I could then SSH from my VM to any other machines (I believe the NAT adapter allows me to do this) on the network, but I could not SSH from any other machine to the virtual machine (connection timed out). Here's some results from ifconfig that might be useful:

For guest:

eth0      Link encap:Ethernet  HWaddr 08:00:27:e1:60:d4  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::a00:27ff:fee1:60d4/64 Scope:Link

For host:

    ether 00:25:bc:dd:62:80 
    inet6 fe80::225:bcff:fedd:6280%en0 prefixlen 64 scopeid 0x4 
    inet netmask 0xfffff800 broadcast
    media: autoselect (1000baseT <full-duplex,flow-control>)
    status: active

I should mention that the host has a firewall (I think that this might affect things)

Solution 2:

The second thing I was considering is port forwarding ssh from the host to the guest. I can set it up so that port XXXX on the host machine forwards to port 22 on the guest machine, however the port XXXX on the host machine cannot be accessed.

ssh -p 2222

gives a connection timed out error.

I am pretty sure this is related to the firewall, but I can't play around with the firewall because I don't have administrative access.

How can I get this working?

  • I assume you've tried turning off the firewall on the host? Also, what kind of network do you have? Is it a corporate network? Is the network checking MAC addresses and only allowing validated machines onto the network? – Julian Knight Jul 18 '12 at 21:35
  • I cannot turn off the fire wall, because I am not an administrator on my machine. It is a corporate network (I am interning for a NASA facility) and I know that it does check MAC addresses, but I don't know terribly much else. I was considering talking to one of the administrators of the network to see if I can find a way around the firewall (so that I can use the port forwarding solution), but I haven't yet. – Aric Hunter Jul 18 '12 at 22:37
  • OK, I've added an answer - such as it is. – Julian Knight Jul 19 '12 at 10:07

The problem is that when you fire up the VM with the bridged connection, the VM has it's own MAC address associated with the virtual LAN card.

This address is not registered with the smart switches that NASA are using. So your "new machine" cannot connect to the LAN.

The only way around this is to register the VM's MAC address with the switches. You will need to get the IT guys to do this.

  • I do believe you hit the nail on the head. Thanks – Aric Hunter Jul 19 '12 at 15:00
  • No worries, good luck with the network admins. – Julian Knight Jul 19 '12 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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