How to view GUI of desktop version of ubuntu 22.04 in LXD


I installed “ubuntu/jammy/desktop” Virtual Machine in my LXD and the instance has been started. Now how do I view the Graphical User Interface of that Ubuntu 22.04 Virtual machine?
The last virtual machine is the one I want to view.

Thank you.

lxc console ubuntu-desktop-22-04-vm --type vga

Thank you for your reply @stgraber , it worked for me. However I had to install
sudo apt-get install virt-viewer
before viewing the desktop.

Some more clarifications needed:

  1. It automatically logs in to a account called “ubuntu”. But after it gets locked due to inactivity, I couldn’t login back since I don’t know what is the default password for “ubuntu” account.
  2. I’m not understanding how I’m able to ping and get the response, but the connection status icon doesn’t display on the top right corner and it shows “unmanaged network” which means it has not connected to internet.
  3. Also why I can’t find “Ubuntu Software center” and “Firefox” which comes with Ubuntu by default?

Thank you

How can I use Incus to start a desktop environment (like Gnome or XFCE) in an Ubuntu Desktop 22.04 virtual machine and then connect to the login screen? Must I first install the desktop environment inside the virtual machine and then launch it manually? What changes must I make to the virtual machine profile, if any?

incus launch images:ubuntu/22.04/desktop desktop-vm --vm -c limits.cpu=4 -c limits.memory=4GiB --console=vga

That will create a VM with 4 vCPUs, 4GiB of RAM using our premade desktop image and immediately attach you to the VGA console.

1 Like

Thank you! I had mistakenly launched the “minimal” or server image ubuntu/22.04 rather than ubuntu/22.04/desktop. Launching an Ubuntu Desktop virtual machine was much easier than I expected!

1 Like