Using a linux VM under windows.

Install a vm

  1. Obtain and install a free virtual machine player from vmware.com.
  2. Obtain a virtual machine image. Ask for a link from Dr. Freudenthal. Copy it to your machine. You'll have better performance if you tell your virus scanner to ignore that directory.
  3. Start the vm player and point it at the virtual machine image.

Setting up host files

/etc/hosts provides a mapping between ip address and hostname. I call my "host" machine effectively named "hw" and my "guest" machine named "vm". Leaving nothing to the imagination, here's the contents of my /etc/hosts file:

127.0.0.1       localhost
192.168.60.128  vm
192.168.60.2    hw

Use ifconfig to determine your virtual machine's ip addr (mine is 192.168.60.128):

freudent@vm:~> /sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:8E:D0:C4  
          inet addr:192.168.60.128  Bcast:192.168.60.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe8e:d0c4/64 Scope:Link
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:225 errors:0 dropped:0 overruns:0 frame:0
          TX packets:171 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:85104 (83.1 Kb)  TX bytes:23905 (23.3 Kb)
          Interrupt:10 Base address:0x1424 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:380 (380.0 b)  TX bytes:380 (380.0 b)

Use route -n to determine your virtual machine's default route (which is the address it uses to communicate with your host). It's the entry with the "UG" flag and matches all patterns since its ip address is 0.0.0.0 and its mask is 0.0.0.0. (anything anded with 0 is 0!)

freudent@vm:~> /sbin/route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.60.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.60.2    0.0.0.0         UG    0      0        0 eth0

You will need to add these entries for "vm" and "hw" to

You can check if this works by pinging (from both the host and the guest):

[root@vm:etc]$ ping vm
PING vm.site (192.168.60.128) 56(84) bytes of data.
64 bytes from vm.site (192.168.60.128): icmp_seq=1 ttl=64 time=2.56 ms
64 bytes from vm.site (192.168.60.128): icmp_seq=2 ttl=64 time=2.79 ms
^C
freudent@vm:~> ping hw
PING hw (192.168.60.2) 56(84) bytes of data.
64 bytes from hw (192.168.60.2): icmp_seq=1 ttl=128 time=3.59 ms
64 bytes from hw (192.168.60.2): icmp_seq=2 ttl=128 time=2.80 ms
64 bytes from hw (192.168.60.2): icmp_seq=3 ttl=128 time=1.00 ms
^C

Log into your guest linux virtual machine

If you don't already have an account on the guest/linux system, make one with yast. I suggest that you make your username on the guest the same as under your host. Unix doesn't like " " (space chars) in usernames, so I suggest eliminating them in your windows username.

Just ssh to "username@vm" and login with your passwd.

Starting a cygwin X server under windows

Start by installing EVERYTHING for the current cygwin. Cygwin is available for download from http://www.cygwin.com.

The X window server can be started from the Start menu using the Start X Server entry of the Singular CAS entry. This will also start a initial xterm window, and will shutdown once that window closes. Additional Xterms can be started using the Xterm entry from the Cygwin-X menu.

Starting an Xterm on the VM that displays on HW's X Server

My script "vmxterm" on my host (in ~/bin/vmxterm) does all of this for me:

freudent@eric-x1 tmp $ cat ~/bin/vmxterm
xhost +vm
ssh -f vm xterm -display hw:0 -ls

The arguments I provided to ssh and xterm select the following extra features:

Picking up a remote file using ssh or scp

let's say you want to pick up a file path/filename from host as user username and stuff it into your current directory.

A few approaches. First, using scp:

 $ scp username@host:path/filename .

For insight on how this is implemented, consider that the following command will the same effect:

 $ ssh username@host cat path/filename > ./filename

Of course, you can use tar to conveniently copy many files (the C option causes tar to "chdir":

 $ ssh username@host tar cC path filename1 filename2 | tar x