reset password

Using Virtual Machine (VM)

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 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.

Default VM

Exactly what you can do with the VM depends on the type of the VM. The default VM has two CPU cores, 2GB memory, 40GB disk, running Ubuntu Server 18.04. The VM has OpenSSH pre-installed, and is configured to automatically receive and install all updates, and automatically reboot if it's needed in order to apply certain updates. If you need additional software, you'll have to install them yourself. Note that Ubuntu Server does not have a GUI, and software management is mostly done through the command line tool apt. Please check out Set Up Ubuntu for how to install some commonly used software. DigitalOcean also has lots of tutorials on how to install and use various software.

If you are given a default VM, the following information will 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 password. You can use the passwd command to change the password, and use adduser to create additional accounts for your team members.

To log onto the VM, you need to use a SSH client like PuTTY. For file transfer, use WinSCP or FileZilla or other software that supports the Secure File Transfer Protocol (SFTP). 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.

Other VMs

We can customize the hardware settings and/or install a different OS upon request. However, note that if you want an OS that requires a license (e.g. Windows Server), you'll need to provide the license.

This page has been viewed 9005 times.