# Convert LXD Server to Incus

**URL:** https://discussion.scottibyte.com/t/convert-lxd-server-to-incus/357
**Category:** Uncategorized
**Created:** [February 21, 2024, 9:23pm UTC](https://discussion.scottibyte.com/t/convert-lxd-server-to-incus/357 "2024-02-21T21:23:07Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![scott](https://discussion.scottibyte.com/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@scott](https://discussion.scottibyte.com/u/scott)
#### Post date: [February 21, 2024, 9:23pm UTC](https://discussion.scottibyte.com/t/convert-lxd-server-to-incus/357/1 "2024-02-21T21:23:07Z")

</div>

If you have an existing LXD Server that you would like to convert to an Incus server, then this is the tutorial for you. Incus is the new open source fork of the LXD containerization tool as explained in my video “Incus: The New LXD”.

This video specifically takes an existing LXD server with LXD containers, LXD Virtual machines, LXD Profiles and LXD storage pools and converts it on the fly using an Incus utility called “lxd-to-incus”.

As of February 2024, this tool can convert a LXD 5.0, 5.18, 5.19 or 5.20 server to Incus. As the LXD and Incus forks become more diverse, there is no guarantee that this tool will work in later versions.

Understand that the GUI tool “LXD Dashboard” that I have presented many times on the channel does not support Incus servers and so after migration to Incus this tool will not work. Penning Labs, who developed LXD Dashboard, has a new tool called LXConsole which is a GUI that can manage both LXD and Incus Servers. Watch my video entitled “LXConsole: The New LXD Dashboard” to learn how to install this great utility.

Log into your LXD Server with ssh (substitute your IP address of your LXD server with n.n.n.n):

```auto
ssh n.n.n.n

```

List your containers and perhaps print a screenshot for your records:

```auto
lxc list

```

 ![image](https://discussion.scottibyte.com/uploads/default/original/1X/cf98ec43266a01acf781e2779b9acf5cee324094.jpeg)

List your profiles on your lxd server:

```auto
lxc profile list

```

![image](https://discussion.scottibyte.com/uploads/default/original/1X/c90056ff2ea0ea75b8e8ea8fe1c5344b365003c8.jpeg)

Finally, list your storage pools:

```auto
lxc storage list

```

 ![image](https://discussion.scottibyte.com/uploads/default/original/1X/8492fc99b9d091c181b35039e5952cc4e8660d40.png)

Check to make sure you have a LXD Version between 5.0 - 5.20:

```auto
lxc --version

```

![image](https://discussion.scottibyte.com/uploads/default/original/1X/6d1764207a331ac1a11f4d44617299489ae0343b.png)

Install Incus without initializing the installation.

First, change to the root user.

```auto
sudo su

```

Make a folder to hold the installation key(s) (the -p creates the path only if it doesn’t exist):

```auto
mkdir -p /etc/apt/keyrings/

```

Download the Incus key to the folder we just created.

```auto
curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc

```

Add the repository for Incus using the keys. Cut and paste the entire code segment into your terminal and press enter.

```auto
sh -c 'cat <<EOF > /etc/apt/sources.list.d/zabbly-incus-stable.sources
Enabled: yes
Types: deb
URIs: https://pkgs.zabbly.com/incus/stable
Suites: $(. /etc/os-release && echo ${VERSION_CODENAME})
Components: main
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/zabbly.asc

EOF'

```

Update the repositories and exit root.

```auto
apt update
exit

```

Install Incus and the zfs-utils package required for conversion:

```auto
sudo apt install incus zfsutils-linux -y 

```

Put your user into the incus admin group and verify:

```auto
sudo usermod -aG incus-admin scott
newgrp incus-admin
groups

```

Now we are ready to convert the LXD Server to an Incus Server with the following command:

```auto
sudo lxd-to-incus

```

 ![image](https://discussion.scottibyte.com/uploads/default/original/1X/e28b599ff9fb47a53e17f544fd6b77ce80a5083d.png)

In my video, the command above failed and I needed to issue the following command to remove the unsupported core.trust\_password mentioned:

```auto
lxc config unset core.trust_password 

```

Now I am able to run the conversion:

```auto
sudo lxd-to-incus

```

![image](https://discussion.scottibyte.com/uploads/default/original/1X/62f132cec592c4fe8d66da25553bcdcc0dc3bd00.jpeg)

I answer “yes” to the prompt above.

![image](https://discussion.scottibyte.com/uploads/default/original/1X/3d07dec131ec10fd220dc47b7639751ae823520d.png)

I also answer “yes” to uninstall LXD in the prompt above.

![image](https://discussion.scottibyte.com/uploads/default/original/1X/6d1e81659a4711355f585a9de0ebb71ebee1ac2e.png)

The conversion is now complete. We can now list the Incus containers and we see that all of the LXD containers are now Incus containers.

```auto
incus list

```

 ![image](https://discussion.scottibyte.com/uploads/default/original/1X/9850e1b927c232c1751f1285dce5804a90101c58.jpeg)

We can list the profiles.

```auto
incus profile list

```

![image](https://discussion.scottibyte.com/uploads/default/original/1X/d049f759a98172d4cdeea95f2a2e9a560d0ada28.png)

Finally, we can list the storage pool.

```auto
incus storage list

```

 ![image](https://discussion.scottibyte.com/uploads/default/original/1X/1871fb1241440e67cb492bab00d74fa7d926a97d.png)

In the tutorial, I demonstrated that LXD Dashboard can no longer see or manage your containers because they are in Incus. Assuming you installed LXConsole via my video entitled “LXConsole: The New LXD Dashboard”, the following steps show how I added my “mondo” Incus server to LXConsole since LXConsole can manage both LXD and Incus servers.

LXD Dashboard no longer sees mondo because it is not running LXD:

 ![image](https://discussion.scottibyte.com/uploads/default/original/1X/4069521abfcbc8d24664e4a5578225b236eb3fc2.png)

In LXConsole, I choose the “+Server” option to add the mondo Incus server.

 ![image](https://discussion.scottibyte.com/uploads/default/original/1X/2cf91971202b495790cb471cd2e7b34f2f8b04de.png)

Click on “here” in the previous screenshot which is highlighted in blue.

![image](https://discussion.scottibyte.com/uploads/default/original/1X/5adf179611bdcd0c256bcb99ce759b645d18b13d.png)

Select and copy the certificate from the page that is displayed being sure to get the Begin and End certificate lines as well.

 ![image](https://discussion.scottibyte.com/uploads/default/original/1X/774847a0c029247d423e52d549b2fde300fdefc2.jpeg)

Go back to the terminal on your Incus Server and edit a file to hold the certificate:

```auto
nano lxconsole.crt

```

Insert the contents of your cut buffer into the nano editor with Shift CTRL V. Do a CTRL O and Enter to write the file out and a CTRL X to exit the nano editor.

Perform the following two commands at the terminal to authorize the ceritifcate on the Incus server and allow access from lxconsole:

```auto
incus config trust add-certificate lxconsole.crt
incus config set core.https_address=[::]:8443

```

Click the “Dismiss” button on the web page as shown below:

 ![image](https://discussion.scottibyte.com/uploads/default/original/1X/3abab82f10497773a36b7dcb4f3243a067d0e1c5.jpeg)

Back on the “Add LXD/Incus Server” screen, click submit to now add the server as one that can be managed.

![image](https://discussion.scottibyte.com/uploads/default/original/1X/9e3ca3099fa48cee4793c5a740dc0d98446c5ab6.png)

Now I am able to click “mondo” from the server page in LXConsole and I can see all of my Incus containers and manage them.

 ![image](https://discussion.scottibyte.com/uploads/default/original/1X/ad71075d2d4e04e305c27f00a60b6b6de0950299.jpeg)

Enjoy your new Incus Server!

---

<div class="post-metadata">

### Author: ![LN907](https://discussion.scottibyte.com/letter_avatar_proxy/v4/letter/l/b4bc9f/32.png) [@LN907](https://discussion.scottibyte.com/u/LN907)
#### Post date: [May 2, 2024, 6:06am UTC](https://discussion.scottibyte.com/t/convert-lxd-server-to-incus/357/2 "2024-05-02T06:06:06Z")

</div>

Hi, Scott it’s me again!

So I finally migrated over to incus. One small problem. I keep getting the following error when trying to use any incus commands from my non-root account.

“Error: You don’t have the needed permissions to talk to the incus daemon (socket path: /var/lib/incus/unix.socket)”

I used sudo usermod -aG incus-admin my user and also added myuser to the regular incus group that was created but I am only able to communicate with the incus server when I assume root on my host. Any idea what that may be about?

---

<div class="post-metadata">

### Author: ![scott](https://discussion.scottibyte.com/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@scott](https://discussion.scottibyte.com/u/scott)
#### Post date: [May 2, 2024, 6:21am UTC](https://discussion.scottibyte.com/t/convert-lxd-server-to-incus/357/3 "2024-05-02T06:21:08Z")

</div>

Yes, you didn’t add your account to the incus-admin group before the conversation.  
Ask questions in the Rocketchat please.

---

<div class="post-metadata">

### Author: ![LN907](https://discussion.scottibyte.com/letter_avatar_proxy/v4/letter/l/b4bc9f/32.png) [@LN907](https://discussion.scottibyte.com/u/LN907)
#### Post date: [May 2, 2024, 6:25am UTC](https://discussion.scottibyte.com/t/convert-lxd-server-to-incus/357/4 "2024-05-02T06:25:23Z")

</div>

You are correct there sir! Thanks for the quick response.

---

<div class="post-metadata">

### Author: ![jsother](https://discussion.scottibyte.com/letter_avatar_proxy/v4/letter/j/7bcc69/32.png) [@jsother](https://discussion.scottibyte.com/u/jsother)
#### Post date: [February 13, 2025, 2:51am UTC](https://discussion.scottibyte.com/t/convert-lxd-server-to-incus/357/5 "2025-02-13T02:51:51Z")

</div>

FYI - If anyone was late in converting and now have a higher version of LXD (e.g. 6.1) that won’t convert with the lxd-to-incus tool, this worked for me.

- Install latest version of Incus
- Initialize as per Scott’s instructions, including making a bridgeprofile if desired.
- Create and export images of your existing containers, which you can import into Incus (see below)

```auto
lxc publish CONTAINER_NAME/SNAPSHOT_NAME --alias lxc-export
 lxc image export lxc-export .
 incus image import TARBALL --alias incus-import
 incus init incus-import NEW-CONTAINER

```

You will still have to add the bridgeprofile profile to your container, and any devices but your LXD containers should now run in Incus a-okay.

P.S. I’m sure there is a more efficient method(s) (i.e. I guess you could add bridgedprofile during incus init of an image) but this worked for me and I’m just a beginner to Linux containerization. 😀

Kudos to Scott for his excellent work and videos!
