reset password

Using Virtual Machine (VM)

1. Information about VM

You should receive an email containing the following information:

(a) The address of the host (i.e. the server that runs the VM).

(b) A VNC port number and password.

VNC is a protocol similar to Remote Desktop Connection (a.k.a. RDP) on Windows -- it allows you to interact with the screen of a remote computer as if you are sitting in front of it. You'll need a VNC client to connect to the VM. There are many VNC client software you can choose from, like TightVNC and RealVNC, and Mac OS X users can use the built-in Screen Sharing program (so I've heard).

(c) A list of port mappings between the VM and the host, e.g. "22/4022 80/4080", which means port 22 and 80 on the VM are mapped to port 4022 and 4080 on the host, respectively.

The reason we need to have port mapping (a.k.a. port forwarding) is because a VM only has a private IP address therefore cannot be accessed directly from the outside world. The situation is, in fact, like a home network where you have a router and a number of devices (i.e. computers, smart phones and such) behind the router. In a typical home network, only the router has a "real" IP address assigned by your internet service provider, while your devices only have private IP addresses assigned by the router. In our case with VMs, the server plays the role of the router, and the VMs are the devices behind the router. In both cases, the devices can access the outside world using a mechanism called Network Address Translation (NAT), but in order for the outside world to connect to services running on the VMs, additional configuration of port mapping is needed.

For example, suppose you want to run a Tomcat server at port 8080 on your VM, and your VM has an IP address 192.168.0.100. Normally we can simply go to the URL http://192.168.0.100:8080 to access the Tomcat server, but because 192.168.0.100 is a private IP address, this won't work. Instead, we have to map a port on the host, say port 4088, to port 8080 on the VM -- what this means is that any data sent to port 4088 of the host will be automatically forwarded to port 8080 of the VM. In other words, to access the Tomcat running at port 8080 on the VM, a user needs to go to the URL http://<host>:4088 where <host> is the name or IP address of the host server.

Due to security concerns, there are additional restrictions on how VMs can be accessed over the network. In particular, you should be able to access your VM on campus over both wired and wireless network. If you are off-campus, you have to use VPN to connect to your VM.

Exactly what you can do with the VM depends on the type of the VM. The following sections will give more details on each type of VM:

2. Ubuntu Server

The current Ubuntu Server VM uses Ubuntu Server 16.04.4 LTS. The VM has two virtual CPUs, 2GB memory, and a 40GB disk. The following package options were selected during installation:

  • LAMP Server
  • Mail Server
  • PostgreSQL Database
  • Standard System Utilities
  • OpenSSH Server

And the server is configured to automatically receive and install all updates, and automatically reboot if it's needed in order to apply certain updates.

2.1 Access to VM

Like any other VM types, you can use VNC to access the VM. You can also use a SSH client like PuTTY to connect to the VM via SSH. The SSH service runs at port 22 on the VM, and as we explained earlier, because of port forwarding, to connect to the VM using SSH, you need to specify the host to be the host server running the VM, and the port to be the port on the host server that is mapped to port 22 on the VM.

Because Ubuntu Sever does not have a GUI interface, regardless of whether you use VNC or SSH, you'll have to do your work on the command line. So get familiar with some common commands and tools, like the apt-get command for managing software packages, and some console-based text editor like vi or nano so you can edit configuration files.

2.2. Additional Information and Configuration

In addition to the information in Section 1, the following information should also be included in the email sent to you:

  • The username and password of a user with sudo privilege
  • The password of the MySQL root user

The first thing you should do after getting your VM is to log into the VM and change the passwords ASAP.

You can use the passwd command to change the system user password, and use adduser to create additional accounts for your team members.

You can connect to MySQL and change the root user's password as follows:

> mysql -u root -p
mysql> set password = password( 'new_password' );
mysql> quit

For installing and configuring other software, you may find this guide helpful.

3. Centos Server

The current Centos Server VM uses Centos 7. The VM has two virtual CPUs, 2GB memory, and a 40GB disk. The following options are selected during installation:

  • Minimal Install
  • KDump disabled
  • Default Security Policy

And the server is configured to automatically receive and install all updates.

3.1 Access to VM

Like any other VM types, you can use VNC to access the VM. You can also use a SSH client like PuTTY to connect to the VM via SSH. The SSH service runs at port 22 on the VM, and as we explained earlier, because of port forwarding, to connect to the VM using SSH, you need to specify the host to be the host server running the VM, and the port to be the port on the host server that is mapped to port 22 on the VM.

Because we didn't install a GUI for the server, regardless of whether you use VNC or SSH, you'll have to do your work on the command line. So get familiar with some common commands and tools, like the yum command for managing software packages, and some console-based text editor like vi or nano so you can edit configuration files.

3.2. Additional Information and Configuration

In addition to the information in Section 1, the following information should also be included in the email sent to you:

  • The username and password of a user with sudo privilege

The first thing you should do after getting your VM is to log into the VM and change the passwords ASAP.

You can use the passwd command to change the system user password.

DigitalOcean has lots of tutorials on how to install and use software packages on Centos. Here are a few that you may find helpful:

 

This page has been viewed 9104 times.