Access to the Virtual Machine

Once the virtual machine is up and running, you can access it using either the Virtual Network Computing (VNC) client or the serial console from the SUSE Virtualization UI.

Additionally, you can connect directly from your computer’s SSH client.

Access with the SUSE Virtualization UI

Virtual machines can be accessed from the UI directly using either VNC or the serial console.

If the VGA display is not enabled on the virtual machine, e.g., the Ubuntu-Minimal-Cloud image, the virtual machine can only be accessed with the serial console.

access to vm

SSH Access

SUSE Virtualization provides two ways to inject SSH public keys into virtual machines. Generally, these methods fall into two categories. Static key injection, which places keys in the cloud-init script when the virtual machine is first powered on; dynamic injection, which allows keys or basic auth to be updated dynamically at runtime.

Static SSH Key Injection via cloud-init

You can provide ssh keys to your virtual machines during the creation time on the Basics tab. Additionally, you can place the public ssh keys into your cloud-init script to allow it to take place.

vm ssh keys

Example of SSH key cloud-init configuration:

#cloud-config
ssh_authorized_keys:
  - >-
    ssh-rsa #replace with your public key

Dynamic SSH Key Injection via Qemu guest agent

SUSE Virtualization supports dynamically injecting public ssh keys at run time through the use of the qemu guest agent. This is achieved through the qemuGuestAgent propagation method.

This method requires the qemu guest agent to be installed within the guest virtual machine.

When using qemuGuestAgent propagation, the /home/$USER/.ssh/authorized_keys file will be owned by the guest agent. Changes to that file that are made outside of the qemu guest agent’s control will get deleted.

You can inject your access credentials via the SUSE Virtualization UI as below:

  1. Select the virtual machine and click button.

  2. Click the Edit Config button and go to the Access Credentials tab.

  3. Click to add either basic auth credentials or ssh keys, (e.g., add opensuse as the user and select your ssh keys if your guest OS is OpenSUSE).

  4. Make sure your qemu guest agent is already installed and the virtual machine should be restarted after the credentials are added.

You need to enter the virtual machine to edit password or remove SSH-Key after deleting the credentials from the UI.

vm add access credentails

Access with the SSH Client

Once the virtual machine is up and running, you can enter the IP address of the virtual machine in a terminal emulation client, such as PuTTY. You may also run the following command to access the virtual machine directly from your computer’s SSH client:

 ssh -i ~/.ssh/your-ssh-key user@<ip-address-or-hostname>