How to convert LXC containers to LXD containers? (2024)

Applicable Products:

Solution

Follow the steps below to convert the LXC containers to LXD containers.

Important

  • The LXD container converted from the LXC container does not support the duplicate function.
  • The static IP address will be reconfigured to DHCP IP address during the LXC to LXD conversion process.
  • Since the original LXC container was running in privileged mode, the LXD container converted from the LXC container will run in privileged mode as well.

Stop and Export LXC Containers

  1. Launch Container Station.
  2. Stop the LXC containers that are planned to convert.
  3. Navigate to Export page.
  4. Click + Export container. Select the LXC containers that are planned to convert and click Export.
    How to convert LXC containers to LXD containers? (1)
    The LXC container that are planned to convert will be successfully exported for backup purposes.

Convert LXC Containers to LXD Containers

1. Access system via SSH connection with “admin” account.

2. Navigate to the Container Station installed location.

  • QTS[~]#cd /share/CACHEDEV*_DATA/.qpkg/container-station/
  • Hero[~]#cd /share/ZFS*_DATA/.qpkg/container-station/

Note: CACHEDEV*_DATA and ZFS*_DATA depend on where Container Station is installed.

3. Navigate to the tool location.

[~]#cd ./usr/bin/

4. Input conversion commands, refer to Conversion Commands at the end of document.How to convert LXC containers to LXD containers? (2)
Specified LXC containers will be converted to LXD containers successfully.

Start and Check the Converted LXD Container

  1. Navigate to Container page.
  2. Start the converted LXD containers.
    How to convert LXC containers to LXD containers? (3)
  3. Check the LXD container data integrity.
    How to convert LXC containers to LXD containers? (4)
    The LXD container data will be the same as the source LXC container.

Conversion Commands

Usage
$ ./qmigration-tool_0.1.0_amd64 migrate lxd [OPTIONS]
Options
Name, shorthandDescription
--nameSpecify the LXC container name to be converted.
--deleteRemove the source LXC containers after conversion.
Examples

Convert a specified LXC container.

$ ./qmigration-tool migrate lxd --name ubuntu-bionic-1

Convert all LXC containers.

$ ./qmigration-tool migrate lxd

Convert and remove a specified LXC container.

$ ./qmigration-tool migrate lxd --name ubuntu-bionic-1 --delete

Convert and remove all LXC containers.

$ ./qmigration-tool migrate lxd --delete
How to convert LXC containers to LXD containers? (2024)
Top Articles
Latest Posts
Article information

Author: Trent Wehner

Last Updated:

Views: 5365

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Trent Wehner

Birthday: 1993-03-14

Address: 872 Kevin Squares, New Codyville, AK 01785-0416

Phone: +18698800304764

Job: Senior Farming Developer

Hobby: Paintball, Calligraphy, Hunting, Flying disc, Lapidary, Rafting, Inline skating

Introduction: My name is Trent Wehner, I am a talented, brainy, zealous, light, funny, gleaming, attractive person who loves writing and wants to share my knowledge and understanding with you.