UP | HOME

Class 4: VMWare Ubuntu Virtual Machine

Table of Contents

Introduction

Before this lecture, we used putty on Windows to log into researchtools.ccom.nh using the ssh protocol. In this lecture we will download a Ubuntu Virtual Machine that can be run from the VMWare Player.

Troubles connecting to irc.freenode.net    irc

We hit serious trouble in this class with irc.freenode.net. CCOM uses network address translation just like you usually do at your house. All of the computers at CCOM look like they are ccom.unh.edu to the outside world and inside computers all have IP addresses like 192.168.*.* (which is a local use only address).

In future classes we will use an irc server that is inside of CCOM. This has the drawback that you must be inside of CCOM to access the IRC server.

What is a virtual machine or "VM"?

http://en.wikipedia.org/wiki/Virtual_machine

A virtual machine is basically an entire computer inside of another computer. You start with a "host" computer which in our case is the Windows 7 PC's. This could also me a Linux or Mac computer. On that computer, you run a program that provides and environment that looks like a bare computer without an operating system. This software simulates hardware and passes information between the "guest" operating system that runs inside this program and the host computer. In this way, we will be able to run Ubuntu Linux in a window on the Windows 7 computers. You can even run multiple virtual machines at the same time.

There are many different "virtualization" software systems out there. The most common that you are likely to run into are:

Both work quite well on recent computers. I met with the CCOM IT team and we decided to use VMWare Player for this class, but it would be possible to duplicate everything that we do on VirtualBox.

See Also

VirtualBox

While we are not using VirtualBox in this class, learning more about it will definitely help you understand what we are doing with the VMWare Virtual Machine.

In FLOSS Weekly 130 - Virtual Box, Randal Schwartz interviews to key people in the Virtual Box project. You will see these notes link to a number of his "Free Libre Open Source Software" podcasts.

Installing the virtual machine

You need to have VMWare Player to be able to run the virtual machine on Microsoft Windows. Download two files from the class web site. In the web browser, use right-click and save as to copy both files into a folder on your desktop (or the location of your choice).

http://vislab-ccom.unh.edu/~schwehr/Classes/2011/esci895-researchtools/virtual-machines/

At this point in the class, we are using "vm-20110908", but there may be a newer virtual machine if you come back later. Get the newest one by going into the directory and getting

  • ubuntu-rt-20110908.vmx
  • ubuntu-rt-20110908.vmdk

The second file will take a long time, as it is a 4GB file.

Starting the virtual machine

Double click the ubuntu-rt-20110908.vmx file and VMWare Player should start. When you see the login page, click on "research tools" to log in as that user. The password is:

!rt2011vm

Normally, having a password that everyone knows is a very bad idea. However, for the time you are in this class, it is okay to leave the password the way it is. Once you are done with the class, you should change the password using this command from the terminal

passwd

Keeping the virtual machine up-to-date    updates sysadmin

With any operating system, it is important to keep the system up-to-date. Having all the latest patches and versions of software will help to protect your system from troubles.

From the command line

You can do an update from the terminal command line like this:

sudo apt-get update
sudo apt-get upgrade

The sudo command executes commands as another user. The researchtools account is an "administrator" type account and running sudo without specifying a user runs a command as the super user otherwise known as "root". With sudo, there is no actual password for root and every command run with sudo is logged by the system.

From the Graphical User Interface (GUI)

System -> Administration -> Update Manager

When done for the day

When you are done with a virtual machine for a time, there are several things you can do to leave it.

Leave it running

The console of the virtual machine will be protected by the screen lock of the host operating system, so it should not hurt to leave Ubuntu running and your account logged in with the virtual machine.

The downside of this is that the virtual machine will use system resources (RAM, CPU, etc) and will slightly slow down the rest of your system. This is probably not important unless you are doing large computationally expensive tasks on your computer.

Suspend/Hypernate it from Ubuntu

There is a circle icon with a vertical slash at the top. Select that and then Suspend or Hibernate. I have not tried either, but they should work.

Suspend from VMWare

This will capture the state of the virtual machine and completely suspend it. The one problem with this method is that the clock will be wrong in the virtual machine. You will want to run this command when you un-suspend the virtual machine to set the clock:

sudo ntpdate ntp.ubuntu.com

Shutdown from Ubuntu

If you a full shutdown (next to the hibernate and suspend in the menu under the "power button" on the top right, the system will go through the full clean shutdown of all processes. While I have had excellent experiences with leaving Ubuntu servers running in remote locations for up to 2 years without a reboot, I would recommend rebooting at least every week or two with a desktop Ubuntu environment.

An example of a Linux server that has not been rebooted in almost a year:

uptime

How was the virtual machine setup?

See these notes, which are very much a work in progress:

http://vislab-ccom.unh.edu/~schwehr/rt/virtual-machine.html

Other virtual machines

You can make your own virtual machine or there are quite a few starter virtual machines.

TODO Suggestions for what else should be in the lecture notes?

I am looking for community feedback, but especially on this class. If you are not at CCOM and followed along, I am looking for feedback and/or contributions for the content.

Author: Kurt Schwehr

Date: <2011-09-08 Thu>

HTML generated by org-mode 7.4 in emacs 23