CS419 - Logging in to VMs via SSH

So logging in via X11 sucks. The problem with this is that you don’t know where the machine is and what address it is on. There is a way to programmatically find this information, but it relies on you having access to the .vmx file (which we don’t have). This feature is in development, but until then…

Find your VM

Your VM can exist on any ilab machine. Let’s find it.

pdsh -R ssh -w ^ilabMachines.txt "ps -ef | grep cs419-grp21-[1]"

Replace your VM name as needed. You should see something along the lines of:

utility.cs.rutgers.edu: vmuser   20766     1  0 Mar23 ?        00:01:35 /usr/lib/vmware/bin/vmware-vmx -s vmx.noUIBuildNumberCheck=TRUE -# product=1;name=VMware Workstation;version=9.0.0;buildnumber=812388;licensename=VMware Workstation;licenseversion=9.0; -@ duplex=3;msgs=ui /.freespace/vmctl/images/cs419-grp21-1/Debian_6.vmx

If you don’t make sure your VM is running and try again.

For more information on pdsh, check out V’s blog post.

ilabMachines.txt

awk.cs.cs.rutgers.edu
cd.cs.rutgers.edu
chmod.cs.rutgers.edu
cp.cs.rutgers.edu
grep.cs.rutgers.edu
kill.cs.rutgers.edu
last.cs.rutgers.edu
less.cs.rutgers.edu
ln.cs.rutgers.edu
ls.cs.rutgers.edu
man.cs.rutgers.edu
mkdir.cs.rutgers.edu
mv.cs.rutgers.edu
ping.cs.rutgers.edu
pwd.cs.rutgers.edu
rm.cs.rutgers.edu
sed.cs.rutgers.edu
top.cs.rutgers.edu
vi.cs.rutgers.edu
adapter.cs.rutgers.edu
builder.cs.rutgers.edu
command.cs.rutgers.edu
composite.cs.rutgers.edu
decorator.cs.rutgers.edu
design.cs.rutgers.edu
facade.cs.rutgers.edu
factory.cs.rutgers.edu
flyweight.cs.rutgers.edu
interpreter.cs.rutgers.edu
mediator.cs.rutgers.edu
null.cs.rutgers.edu
patterns.cs.rutgers.edu
prototype.cs.rutgers.edu
singleton.cs.rutgers.edu
specification.cs.rutgers.edu
state.cs.rutgers.edu
strategy.cs.rutgers.edu
template.cs.rutgers.edu
utility.cs.rutgers.edu
visitor.cs.rutgers.edu
assembly.cs.rutgers.edu
cpp.cs.rutgers.edu
pascal.cs.rutgers.edu
php.cs.rutgers.edu
python.cs.rutgers.edu
basic.cs.rutgers.edu
java.cs.rutgers.edu
lisp.cs.rutgers.edu
perl.cs.rutgers.edu
prolog.cs.rutgers.edu

Find the IP Address

To find the IP address, SSH into the machine you found above. Then look in /etc/vmware/vmnet8/dhcpd/dhcpd.leases. This file is the list of all IP addresses the machine gave to running VMs. These usually start from 192.168.230.192 and increase sequentially from there. Now unfortunately since we do not have access to the .vmx file, we cannot determine which address corresponds to which VM. Therefore the only way to figure out which address is yours is to try and ssh into each. This should only be 1-5 addresses so it shouldn’t be that bad.

Note: The VMs get their addresses via DHCP so they can change!