VGA console connect

Hello,
After the updation of lxd 4.4, I am trying to create a windows VM on a remote linux server. I am using this document for the creation. After the step lxc console vmname --type=vga, I am getting the following

LXD automatically uses either spicy or remote-viewer when present.
As neither could be found, the raw SPICE socket can be found at:
spice+unix:///root/.config/lxc/sockets/

How can I use VGA console to see the installer boot? Can anyone please explain?

Thank you !!

Did you install either spicy or remote-viewer packages?

No, Is it install on my local computer ? I’m using a windows PC now. So how can I connect to remote machine from my local windows PC?

LXD 4.5 (to be released today/tomorrow) will properly support detecting and using virt-viewer on Windows.

You could already make this work by installing it either manually from https://virt-manager.org/download/sources/virt-viewer/virt-viewer-x64-9.0.msi or using Chocolatey.

Once installed, LXD 4.5 or before it’s released, a recent upstream build like https://ci.appveyor.com/api/buildjobs/cv9axfm5gido30i1/artifacts/lxc-4.4-windows-amd64.zip will detect it and use it.

1 Like

sorry, I need more clarification about that. In my case, I configured LXD on a remote Linux server and created VM through ssh, Now I am trying to connect the VM from my windows laptop to perform the installation.
How can I connect to the VM to perform the installation?

On the server, do:

  • lxc config set core.https_address :8443
  • lxc config set core.trust_password some-password

On Windows, download the .zip I linked, extract lxc.exe from it, then from a terminal do:

  • lxc remote add my-server IP-ADDRESS
  • [accept fingerprint and enter the password you set earlier]
  • lxc remote switch my-server
  • lxc list
  • lxc console NAME --type=vga

That assumes you’ve also installed virt-viewer using the .msi I linked earlier.

3 Likes

Abled to connect to the VM
@stgraber Thanks for the faster response

Is there any document to remote access from spice client on ubuntu instead using lxc cli?

The Windows 11 VM on LXD video tutorial shows how to connect to a VM using spice client from Ubuntu:

Thank you
But I want to reach console form remote for example from my desktop to server via a generic desktop app or python code.

LXD will not expose the spice socket over the network. You can run a service inside the VM if you like and expose that over the network.

The way to access the console remotely using LXD is to install the lxc client on your local machine and then interact with the LXD server over the network by setting lxc remotes.

Then you would connect to the local spice socket created by the lxc command.

I think there must be an approach :pensive:
I couldn’t find lxc client source code.
Is it in lxd repository?

This is the lxc command source: lxd/lxc at master · lxc/lxd · GitHub

And this is the Go lxd client package source: lxd/client at master · lxc/lxd · GitHub

The go docs for it are here: lxd package - github.com/lxc/lxd/client - Go Packages
And additional API docs are here: REST API - LXD documentation

1 Like

Just add --debug to the command and start from there. It can be done but you’ll need a spice client to integrate with, spice-html5 is the one LXDMosaic uses.

1 Like

The lxc console command is here: https://github.com/lxc/lxd/blob/master/lxc/console.go

1 Like