SSH your (Arch) Linux VM in VMWare Fusion

So you have (Arch) Linux running in VMWare Fusion and want to access it via SSH from Mac OS X.
The default setting in Fusion is ‚Bridged‘ network connection, where it connects your vm directly to the network just as another computer with an IP adress normally given by the router, so that you just need to find out that IP by ‚ifconfig‘ in Linux and then just ’ssh username@ip-adress‘ in OS X.
If you are always at the same network, you eventually can set your Linux to a static IP adress, e.g. in rc.conf in Arch Linux, so you can save the first step.
But what, if you’re working mobile, beeing in other networks or even beeing offline sometimes … how to ’ssh‘ into your Linux VM?
You will end up using ‚NAT‘ in Fusion.
There is a nice blog entry (http://nileshk.com/vmware-fusion-nat-dhcp-and-port-forwarding) describing how to assign fixed IP adresses to your VM using this setup, including Port forwarding and handles, so that you don’t even have to remember the IP adresses anymore.
However, even if I’m doing as explained, there’s a little difference for me in VMWare Fusion 3.1.0:
With this entry in /Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf:
host arch64 {
hardware ethernet 00:0C:29:79:7E:CE;
fixed-address 192.168.214.100;
}
and
[incomingtcp]
# Forward host port 2222 to SSH on Arch64 VM
2222 = 192.168.214.100:22
in my /Library/Application Support/VMware Fusion/vmnet8/nat.conf
and setting my Linux VM’s IP internally to 192.168.214.100 via Archs /etc/rc.conf:
HOSTNAME=“arch64″
#Static IP
eth0=“eth0 192.168.214.100 netmask 255.255.255.0 broadcast 192.168.214.255″
#eth0=“dhcp“
INTERFACES=(eth0)
# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   – prefix an entry in ROUTES with a ! to disable it
#
gateway=“default gw 192.168.214.2″
ROUTES=(gateway)
the IP adress of the VM, OS X sees, is nevertheless 127.0.0.1, so that I had to put:
#VMWare
127.0.0.1               arch64
into my Macs /etc/hosts file.
Now you should be able to only e.g. ’ssh arch64′ (considering your VM’s name is ‚arch64‘).
That for now. After lasts posts tip to tweak VMWare Fusion to only start background processes if needed (http://forums.macrumors.com/showthread.php?t=960043), and our setup for easy SSH access we are nearing a state, where our Linux VM becomes a viable development environment for Python and web development tasks.

So you have (Arch) Linux running in VMWare Fusion and want to access it via SSH from Mac OS X.

The default setting in Fusion is ‚Bridged‚ network connection, where it connects your vm directly to the network just as another computer with an IP adress normally given by the router, so that you just need to find out that IP by ‚ifconfig‚ in Linux and then just ‚ssh username@ip-address‚ in OS X.

If you are always at the same network, you eventually can set your Linux to a static IP adress, e.g. in rc.conf in Arch Linux, so you can save the first step.

But what, if you’re working mobile, beeing in other networks or even beeing offline sometimes … how to ’ssh‘ into your Linux VM?

You will end up using ‚NAT‚ in Fusion.

There is a nice blog entry describing how to assign fixed IP adresses to your VM using this setup, including Port forwarding and handles, so that you don’t even have to remember the IP adresses anymore.

However, even if I’m doing as explained, there’s a little difference for me in VMWare Fusion 3.1.0:

With this entry in /Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf:

host arch64 {
hardware ethernet 00:0C:29:79:7E:CE;
fixed-address 192.168.214.100;
}

and

[incomingtcp]
# Forward host port 2222 to SSH on Arch64 VM
2222 = 192.168.214.100:22

in my /Library/Application Support/VMware Fusion/vmnet8/nat.conf

and setting my Linux VM’s IP internally to 192.168.214.100 via Archs /etc/rc.conf:

HOSTNAME="arch64"

#Static IP
eth0="eth0 192.168.214.100 netmask 255.255.255.0 broadcast 192.168.214.255"
#eth0="dhcp"
INTERFACES=(eth0)

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 192.168.214.2"
ROUTES=(gateway)

the IP adress of the VM, OS X sees, is nevertheless 127.0.0.1, so that I had to put:

#VMWare
127.0.0.1               arch64

into my Macs /etc/hosts file.

Now you should be able to only e.g. ‚ssh arch64‚ (considering your VM’s name is ‚arch64‘).

That for now. After my last posts tip to tweak VMWare Fusion to only start background processes if needed, and our setup for easy SSH access we are nearing a state, where our Linux VM becomes a viable development environment for Python and web development tasks.

Einen Kommentar schreiben