LXConsole Web Interface for Incus

I have covered LXD Dashboard many times before. LXD Dashboard cannot manage Incus Servers and so you must use LXConsole which is also a product of Penning Labs. LXConsole supports both Incus and LXD Servers and has lots of great new features.

If you have not yet watched “Incus Containers Step by Step”, then go review that before attempting this.

Go over to your Incus server and create a container for lxconsole:

incus launch images:ubuntu/22.04 LXConsole --profile default --profile bridgeprofile -c security.nesting=true -c boot.autostart=true

Connect to the container:

incus shell LXConsole

Update your new container:

apt update && apt upgrade -y

Add a user account and grant it “sudo” privilege:

adduser scott
usermod -aG sudo scott

Install “curl” and “nano” and then install docker and docker-compose:

apt install curl nano
curl -sSL https://get.docker.com | sh	
apt install docker-compose 

Put my user account into the docker group and move over to my account:

usermod -aG docker scott
su - scott

Create a folder for the application (lxconsole) and a folder for container backups/exports (lxcbackups):

mkdir lxconsole lxcbackups

Move into the lxconsole folder and then edit a docker-compose file with nano:

cd lxconsole
nano docker-compose.yml

Insert the following code into the editing session:

services:
  lxconsole:
    image: 'penninglabs/lxconsole:latest'
    restart: unless-stopped
    ports:
      - '80:5000'
    volumes:
      - /home/scott/lxcbackups:/opt/lxconsole/backups
      - ./certs:/opt/lxconsole/certs
      - ./server:/opt/lxconsole/instance

Save the file out with a CTRL O and Enter and then CTRL X to exit the nano editor.

Launch the application:

docker compose up -d

Find out the address of your lxconsole container by looking for the address of eth0:

ip addr show dev eth0

Go into your favorite web browser and type in the address we just found and you will be taken to the lxconsole registration screen. Provide your desired username, email, and password info:

Next, you will be presented with the “servers” screen:

For convenience, go back to your terminal screen for your lxconsole container and edit the hosts file:

sudo nano /etc/hosts

Add the names and addresses for your “incus” server(s) to this file (I added my mondo and vmsmist servers as an example):

Save the file with a CTRL O and enter and a CTRL X to exit the nano editor.

Go back to the lxconsole web interface and click “+ Server” and enter the name of your server:

Click the “here” highlighted in blue for instructions on how to add a certificate trust for the server we are adding:

image

On the next screen that is displayed, select everything from and including —BEGIN CERTIFICATE— to —END CERTIFICATE— and copy as shown:

Go to a terminal on your incus host that we want to manage. Do NOT go to the lxconsole command line. You can actually log off of the lxconsole incus container because we won’t need to access it anymore.

image

At your incus host that we want to manage:

nano lxconsole.crt

Paste the certificate into the editor session that we cut above with a Shift CTRL V.
Do a CTRL O and Enter to save the file and a CTRL X to exit the nano editor.

Add the trust:

incus config trust add-certificate lxconsole.crt

Also, set the management port number access:

incus config set core.https_address=[::]:8443

Although unnecessary, you can list the trusts on your incus server:

incus config trust list

Back at the web interface, you can dismiss the “instructions” screen:

Now, you can click the “Submit” button on the “Add LXD/Incus Server” screen:

image

Now your server will be listed on the “Servers” screen.

You can now click the blue highlighted name of your server on the Servers screen and you will have a summary screen for that incus server:

The lxconsole interface is different from LXD Dashboard interface that I have covered many times. I also have another lxconsole video I did for LXD many months ago. You should be able to explore and learn the interface.

In the video, I added my vmsmist incus server by adding a trust for it as well.

I ended up with two incus servers being managed by lxconsole and you can add more if you have others:

To update your lxconsole when there are new releases, simply connect to your lxconsole incus container:

incus shell LXConsole

Move into the folder and update the docker application:

cd lxconsole
docker compose pull
docker compose up -d

Scott

Your Youtube Video says LXConsole can be used with LXD & Incus!

I have both LXD and Incus installed on my Ubuntu 22.04 machine.

The sudo lxd Init I used Port 8443 for LXD

The sudo incus admin Init I used Port 8444 for Incus

Both LXD and Incus have always worked well using their respective CLI

I installed LXConsole as per your guide.
One deviation i made was that I did not create a
separate *bridged interface for LXD or Incus.

Note: not sure what the purpose of that container bridged interface
is in regards to LXConsole

I can log into LXConsole running in an Incus “nested” Docker container.

Using LXConsole I add 2 servers (one for LXD and one for Incus):
lxconsole-LXD Port 8443
lxconsole-Incus Port 8444

Both Servers use the same Host IP in the Host’s /etc/hosts file.

After that I select the lxconsole-incus “server”
and I Can Create an Incus Container or VM using any of the many “images:

However, *when I select the lxconsole-lxd “server” *
and try to Create a New Instance (container or VM) there are no “images” to select and it just shows “none” !

However LXD does show pre-existing LXD Containers & VMs. It just can create new LXD Containers & VMs.

Note: I am using the new Incus 6.0 LTS
and I am using the newly announced LXD “image” repository.

Your Youtube example only shows configuring & using LXConsole with Incus.

Have you tried installing both LXD & Incus on 1 Host using Ports 8443 & 8444 (or something) and gotten LXConsole to work with both LXD & Incus Containers & VMs yet?

Also, can you give me an idea why you are using: *** --profile bridgeprofile***
What I’d like to know is it relevant to using LXConsole for Both LXD and Incus ??

thanks for your video
brian

Let me see if I can answer. By the way, better to do this in the chat at https://chat.scottibyte.com/. I have several rooms over there related to different subjects.

The purpose of my “bridge0” interface which was initially explained in both my “LXD Step by Step” and my “Incus Step by Step” tutorials is to software bridge LXD/Incus containers to your main LAN. The lxdbr0 and incusbr0 bridges created by “lxd admin init” and “incus admin init” only provide outbound access for containers or inbound access only on the LXD/Incus host. Therefore, bridge0 is a software bridge allowing multiple LXD and/or incus containers to present addresses on your main LAN. This is an advantage in being able to more easily reach apps.

Yes, I have had a LXD and an Incus server presented on the same host and I used ports 8443 and 8445 in my case. My guess as to why you can reach the NAT container for your lxconsole is because you are using your desktop as the LXD and Incus server and the NAT addresses for both LXD and Incus are reachable from the host on which they are running.

In regards to your “image” issue. If you go to the CLI of the LXD server and do a “lxc image list” you will see all images that you have downloaded to build containersin LXD. Likewise, if you do an “incus image list” you will see the list of all images that you have downloaded to build containers in incus. They are separate images and are not shared between LXD and Incus.

If there are no images for Incus, it means that you need to go over to the images section and download at least one image before launching a container. Either that or use the CLI to create your first Incus image.

incus launch images:ubuntu/22.04 Test

The above command will download the Ubuntu 22.04 image and create a container named Test. Even if you stop and delete that container:

incus stop Test
incus delete Test

you can see that the Ubuntu image is still there:

incus image list

Again, lxconsole can only create a container from an image you have downloaded. If you have none downloaded, you can use the launch command to create a container which will download an image or go into the image section in lxconsole and download an image and then you will have an image to create a container from.

I actually have a video entitled “LXConsole: The New LXD Dashboard” which addresses using lxconsole with LXD and I have a video entitled “LXConsole: Web Interface for Incus” which addresses using lxconsole with Incus. As I said, I have both LXD and Incus servers managed by my lxconsole instance.

Just to answer again, bridgeprofile provides an address on the MAIN LAN address range for either a LXD or Incus container.

config: {}
description: Bridge to Main LAN
devices:
  eth0:
    nictype: bridged
    parent: bridge0
    type: nic
name: bridgeprofile

My virtual software switch is a netplan file described in “LXD Step by Step” and also “Incus Step by Step” and basically looks like this:

network:
  version: 2

  ethernets:
    enp3s0:
      dhcp4: false
      dhcp6: false

  bridges:
    bridge0:
      interfaces: [enp3s0]
      addresses: [172.16.1.50/16]
      routes:
         - to: default
           via: 172.16.0.1
      nameservers:
        addresses:
          - 1.1.1.1
          - 1.0.0.1
      parameters:
        stp: true
        forward-delay: 4
      dhcp4: no

Thanks for the reply but I have a couple points:

you wrote:

The purpose of my “bridge0” interface which was initially explained in both my “LXD Step by Step” and my “Incus Step by Step” tutorials is to software bridge LXD/Incus containers to your main LAN. The lxdbr0 and incusbr0 bridges created by “lxd admin init” and “incus admin init” only provide outbound access for containers or inbound access only on the LXD/Incus host. Therefore, bridge0 is a software bridge allowing multiple LXD and/or incus containers to present addresses on your main LAN. This is an advantage in being able to more easily reach apps.

That helps answer why the Bridge Interface was present in your “$ ip a
Yes, I’ve used container & vm bridge interfaces before as well as macvlan, ipvlan etc to have a Host LAN ip.

Yes, I have had a LXD and an Incus server presented on the same host and I used ports 8443 and 8445 in my case. My guess as to why you can reach the NAT container for your lxconsole is because you are using your desktop as the LXD and Incus server and the NAT addresses for both LXD and Incus are reachable from the host on which they are running.
In regards to your “image” issue. If you go to the CLI of the LXD server and do a “lxc image list” you will see all images that you have downloaded to build containersin LXD. Likewise, if you do an “incus image list” you will see the list of all images that you have downloaded to build containers in incus. They are separate images and are not shared between LXD and Incus.
If there are no images for Incus, it means that you need to go over to the images section and download at least one image before launching a container. Either that or use the CLI to create your first Incus image.

I thought I mentioned that I went that route in my attempt to find root cause.

From my CLI I can easily see that both LXD and Incus have full access to their respective image repositories:

$ lxc image list images:

$ incus image list images:

In LXConsole, Incus server works fine using any of the config capabilities and all the Incus Image Server “Images” available are displayed.

But in LXConsole, LXD server does not list any available images even though LXConsole does show the correct Image Server.
note: the just announced NEW Canonical LXD Image Server

For LXD images, LXConsole just displays “None

I had exchanged some email with the LXConsole developer and had suggested there may be an update needed due to the new LXD image Server being introduced.

Also mentioned that now that Incus v6.0 LTS has been released the LXD & Incus APIs are going to start diverge more and more in syntax & capabilities.

He’s working on some of that already.

Some of this I hopes explain why I asked the original questions about installing/running lxconcole & using it on 1 Host to manage both LXD & Incus.

That 1 bridge reference made me wonder if that would have fixed my problem or if it was unrelated as I didn’t create that bridge & went w/out it.

As I mentioned in my initial response, discuss this in the chat at https://chat.scottibyte.com/. I have several rooms over there related to different subjects. Note that “lxc image list images:” with the colon lists the remote repository and without the colon it lists the locally downloaded images.