Access a Virtual Machine

Background Information

After creating virtual machine instances, you need to remote control and manage them. Several remote access methods are listed below.

  • RDP (Remote Desktop Protocol) RDP is a remote desktop protocol commonly used for remote management of Windows operating systems. You're recommended to remote connect to a Windows virtual machine via RDP.

  • SSH (Secure Shell) SSH is a command-line based remote management tool that uses a secure network protocol. SSH is widely used in UNIX-like operating systems, including Linux, BSD, and macOS. You're recommended to use Terminal or Windows PowerShell to establish an SSH connection to non-Windows virtual machines.

  • RFB (Remote FrameBuffer) RFB is a protocol used for graphical remote management. VNC (Virtual Network Computing) is a common remote graphical management tool based on the RFB protocol used in UNIX-like operating systems. VNC login provides a graphical desktop environment, allowing you to interact with the virtual machine visually. VNC protocol is also widely supported across multiple operating systems and platforms, which is more flexible and compatible. You're recommended to remotely access and control the graphical interface of your virtual machines via VNC.

These protocols and tools offer various ways to remotely access and manage virtual machines. RDP provides a graphical interface for Windows virtual machines; SSH offers a command-line interface for remote management of UNIX-like virtual machines, and VNC enables graphical remote management of virtual machines regardless of operating systems.

Here we take a Linux VM (CentOS-1vcpu-2gb-HKG-1) and a Windows VM (Windows-1vcpu-2gb-IAD-1) as examples to demonstrate how to remote access them using you local computer.

  • CentOS-1vcpu-2gb-HKG-1 Default username: root Password: Test+123

  • Windows-1vcpu-2gb-IAD-1 Default username: Administrator Password: Test+123

Note

  • See Create an Instance for detailed information about how to create a virtual machine instance.

  • Your virtual machine will be associated with one security group at least while being created. To remote access successfully, please ensure the security group allows traffic on the following ports: TCP 22 ( for SSH), TCP 3389 (for RDP), and ICMP port (used for network management and debugging).

  • The steps below may vary depending on the operating system and applications you are using. You may need to use different commands or tools to perform the same actions.

Access a Linux Virtual Machine via SSH

When you need to access a Linux virtual machine, you can use SSH. Assume a macOS Terminal and a Windows PowerShell.

If you have deployed the SSH public key to your server, you can also using the SSH key for authentication without entering a password.

Prerequisites

  • Ensure the virtual machine has SSH enabled and is running.

  • Obtain the public IP address of the virtual machine you want to access, that is a Linux VM (CentOS-1vcpu-2gb-HKG-1). You can find this information in the instance list page on zenConsole. Here is 128.1.97.230.

Procedures

  1. Open the Terminal application on your macOS computer. You can find it in the Applications > Utilities folder, or you can use Spotlight to search for it.

  2. In the Terminal, use the SSH command along with the IP address of the virtual machine to establish a remote connection. The command syntax is as follows:

    ssh root@128.1.97.230
  3. Press Enter, and Terminal will attempt to establish an SSH connection to the virtual machine. If this is your first time connecting to the VM, you may be prompted to confirm the authenticity of the host by verifying its key fingerprint. Type yes to proceed.

  4. After the SSH connection is successfully established, you will be prompted to enter the password for the selected username on the virtual machine. Here provide Test+123 and press Enter.

  5. Once authenticated, you will have a Terminal session open on your macOS computer, but with the remote virtual machine's command-line interface. From here, you can execute commands and perform administrative tasks on the virtual machine.

Access a Windows Virtual Machine via RDP

When you need to access a Windows virtual machine, you're recommended to use RDP.

Prerequisites

  • Ensure that the Windows virtual machine is running and has RDP enabled. RDP is available by default on Windows operating systems.

  • Obtain the public IP address of the virtual machine, that is a Windows VM (Windows-1vcpu-2gb-IAD-1). You can find this information in the instance list page on zenConsole. Here is 98.96.218.54.

Procedures

  1. Open the Remote Desktop client application on your local computer. This application is built into Windows, and you can find it by searching for "Remote Desktop" in the Start menu.

  2. In the Remote Desktop client, enter the public IP address, that is 98.96.218.54, of the virtual machine in the "Computer" field.

  3. Click Connect to initiate the connection.

  4. If prompted, enter the credentials for the user account on the virtual machine. - Default username: Administrator - Password: Test+123

  5. Once authenticated, the Remote Desktop client will establish a connection to the Windows virtual machine. You will see the virtual machine's desktop displayed on your local computer.

  6. You can now interact with the Windows virtual machine as if you were sitting in front of it. You can run applications, access files, configure settings, and perform any other tasks you would normally do on a Windows desktop.

Remember to ensure that the necessary firewall rules are configured on both the virtual machine and your local machine to allow RDP connections.

Access a Linux Virtual Machine via VNC

You can remote access a Linux virtual machine via VNC.

Prerequisites

You can remote access any virtual machine vis VNC on zenConsole. Please obtain the public IP address of the virtual machine you want to access before remote access. Here we take the Linux VM (CentOS-1vcpu-2gb-HKG-1) as an example.

  • Default username: root

  • Password: Test+123

Procedures

  1. Go to virtual machine instance list page and click CentOS-1vcpu-2gb-HKG-1 to enter Detail page.

  2. Click VNC Access to enter VNC access interface. Wait until it shows:

    Connected (encrypted) to: QEMU (instance-xxxxxxxx)

    Enter the default username: root, and press Enter

  3. Press Enter, and Terminal will attempt to establish an SSH connection

  4. Enter the password for the virtual machine. Here provide Test+123 and press Enter.

  5. Once authenticated, the VNC will establish a connection to the virtual machine. You should see the VM's desktop or graphical interface displayed in the VNC client window.

  6. (optional) You can paste your code on the Clipboard and click Run to quick run your command.

Access a Windows Virtual Machine via VNC

You can remote access a Windows virtual machine via VNC.

Prerequisites

You can remote access any virtual machine vis VNC on zenConsole. Please obtain the public IP address of the virtual machine you want to access before remote access. Here we take the Windows VM (Windows-4vCPU-16gb-HKG-A-1) as an example.

Procedures

  1. Go to virtual machine instance list page and click Windows-4vCPU-16gb-HKG-A-1 to enter Detail page.

  2. Click VNC Access to enter VNC access interface. Wait until it shows:

    Connected (encrypted) to: QEMU (instance-xxxxxxxx)
  3. Go to Keyboard Shortcuts > Ctrl+Alt+Del.

  4. Find your password in your email box. Click Clipboard, enter the password and click Run.

Summary

The protocols and access methods mentioned above provide convenience and flexibility in different scenarios. You can choose the way that best suits your needs to remotely access and manage your virtual machines, whether it's using a graphical user interface or a command-line interface.

Last updated