-
-
Notifications
You must be signed in to change notification settings - Fork 1
Upgrading from 1.X.X.X to 2.X.X.X
Recently, the larger LXD project was transferred to Canonical. Due to a change in licensing after the transition, LXD is no longer viable to use, however a fork of LXD called incus was made by the original development team, which we can safely consume.
However, this means that updating the manager is not as straight forward as it may seem. In this guide, we will help you transition your v1.X.X.X
install to v2.X.X.X
First, install incus:
- Gentoo:
root # emerge incus
- Arch:
root # pacman -S incus
- Ubuntu:
root # apt install incus
After that, make sure your user is in the incus
and incus-admin
groups:
root # usermod -a -G incus,incus-admin my-user
At this point, it is recommended to reboot/log out of the session to update the groups.
Finally, start the Incus daemon set it to launch by default:
- OpenRC:
root # /etc/init.d/incus start && rc-service add incus default
- SystemD:
root # systemctl start incus.service && systemctl enable incus.service
Next, set up the incus daemon:
- Initialise the daemon:
incus admin init --auto --storage-backend=dir
- Set up the network bridge settings:
incus network set incusbr0 ipv6.nat=false ipv6.address=none
- Restart the daemon:
- OpenRC:
root # /etc/init.d/incus restart
- SystemD:
root # systemctl restart incus.service
- OpenRC:
First, we have to connect LXD with Incus:
- Configure them to listen on the same network:
lxc config set core.https_address :8444 && incus config set core.https_address :8443
- Add LXD remote in Incus:
incus remote add my-lxd unix:///var/lib/lxd/unix.socket
. Note: the location may be different, i.e./var/snap/lxd/common/lxd/
- List the LXD containers from Incus:
incus list my-lxd:
. If all is successful, they should appear. - Stop all active LXD containers using:
lxc stop <container-name-here>
- Transfer the container:
incus move my-lxd:<container-name-here> local:
- Finally, close the connection:
lxc config unset core.https_address && incus config unset core.https_address
Now, update the application to v2.X.X.X
. All code referencing LXD has now been transferred to incus, so nothing much has to be done.
This bonus chapter is made for users that also have LXD VMs that they want to transfer to Incus.
First, we need to check if Incus is capable of creating a VM. Simply run incus create test-vm --vm --empty
. If the VM was created successfully, go to the next heading.
If you get an error like the following:
Error: Failed creating instance record: Instance type "virtual-machine" is not supported on this server: QEMU failed to run feature checks
Stop the Incus service:
- OpenRC:
root # /etc/init.d/incus stop
- SystemD:
root # systemctl stop incus.service
Next, run the Incus daemon from a terminal: root # incusd
.
This should produce an understandable error. One of the most common ones is the following:
ERROR [2024-02-26T18:56:09+02:00] Unable to run feature checks during QEMU initialization: Unable to locate a UEFI firmware
This is fixed by adding an environment variable that points to the edk2
directory that holds the OVMF_CODE.fd
& OVMF_VARS.fd
files:
export INCUS_OVMF_PATH=/usr/share/edk2-ovmf
Check with your local system, as it's usually either edk2
or edk2-ovmf
. Additionally, make sure you have the edk2-ovmf
package installed.
With the new environment variable, the empty container should be created without an issue.
Do the following:
- Make sure the Incus daemon is running and that you can create a VM
- Expose Incus to the network:
incus config set core.https_address :8443
- Run
incus-migrate
- Enter your local IP:
Please provide Incus server URL: 0.0.0.0
- Accept the fingerprint
- Select option
1
to use a token. - In a separate terminal, generate a token using
incus config trust add local:0.0.0.0:8443
- Paste the token output into the wizard
- Select option
2
for a virtual machine - Set the name of the VM
- Find the location of the image of your LXD VM, usually under
/var/lib/incus/virtual-machines/<insert-vm-name>/<image-name>.img
- Paste the location into the wizard
- Disable UEFI Secure Boot
- Select option
3
and set your CPU core allowance. Example:limits.cpu=12
- Select option
3
and set your RAM allowance. Example:limits.memory=16GiB
- Select option
1
and wait for the VM to be migrated - Once migrated, try launching the VM using Incus
This project is supported by all the people who joined our discord server and became beta testers. If you want to join the discord you can click here