Minimum requirement for lxd-p2c

(Markus Heckmann) #1

lxd-p2c is there any snap or apt-get ppa for this migration script. (@stgraber - really like your FOSDEM demo. Thanks


UPDATE: the following is wrong: The tool lxd-p2c is available with the LXD 3.0 snap package as lxd-p2c. My lxd-p2c was actually from ~/GO/bin/ (was compiled from Go).

You can compile it (assuming you have set up the Go language on your computer) with the following:

$ cd /tmp
$ go build
$ ls lxd-p2c
$ ./lxd-p2c --version

(Stéphane Graber) #3

Actually, it’s not in the snap, on purpose.

As the tool is meant to be run on the source machine and such a source machine is very unlikely to be running a modern Linux distribution, the expected way to interact with lxd-p2c is to build it statically with go get then transfer the resulting binary to the system you want to import into LXD.

(Markus Heckmann) #4

Thanks. I compiled the go. I am trying it with desitnation:

  driver: lxc
  driver_version: 2.0.8
  kernel: Linux
  kernel_architecture: x86_64
  kernel_version: 4.13.0-39-generic
  server: lxd
  server_pid: 4840
  server_version: 2.0.11


  driver: lxc
  driverversion: 2.0.7
  kernel: Linux
  kernelarchitecture: x86_64
  kernelversion: 4.4.0-119-generic
  server: lxd
  serverpid: 1432
  serverversion: 2.0.9

It fails with Error: not implemented.
any suggestions to fix.
Basically what are the minimum versions for source and destination. I like to stay with LTS if possible.

(Stéphane Graber) #5

Target should be 2.21 or higher, we haven’t tested with prior releases. I think the “not implemented” there refers to push migration which didn’t exist until a year or so ago.

(Markus Heckmann) #6

Thanks for the quick info. I installed backports… it is now transferring. Let you know how it goes later!
driver: lxc
driver_version: 2.0.8
kernel: Linux
kernel_architecture: x86_64
kernel_version: 4.13.0-39-generic
server: lxd
server_pid: 9484
server_version: "2.21"
storage: zfs

(Markus Heckmann) #7

One more question. Thelxd-p2c <target URL> <container name> <filesystem root> [<filesystem mounts>...] [flags]

Do I assume I need to give / and /home as 2 separate filesystem mounts in the above command.
Edit: Yes.

(Jair Bolivar) #8

Hello all and thank you for the great work!

Here is my issue:

I converted an ubuntu 18.04 LTS from vbox to lxc and I am having the following issue:

Next when I enter the container >

I tried to configure the “/etc/network/interfaces” but after restart the machine still does not not read the config…

I tried adding the ipv4 settings using “ip add blah blah” it takes the values it connects but if I restart it does not retain the settings < after this the connection works and I can interact with the container in the network but after restart all configuration is lost and I see only the ipv6 config

Little help will be greatly appreciated.


(Stéphane Graber) #9

Ubuntu 18.04 uses netplan rather than ifupdown, so you’ll likely need to put network configuration in /etc/netplan/ if you want it to persist.

(Jair Bolivar) #10


Works perfectly!

jair@budgie3:~$ cat /etc/netplan/01-network-manager-all.yaml

Let NetworkManager manage all devices on this system

version: 2
renderer: networkd
dhcp4: no
dhcp6: no
addresses: []
addresses: [,,]


root@server1:~# lxc list
| budgie3 | RUNNING | (eth0) | 2405:6580:2cc0:100:216:3eff:fe2e:a982 (eth0) | PERSISTENT | 0 |
| c1 | STOPPED | | | PERSISTENT | 0 |
| c2 | STOPPED | | | PERSISTENT | 0 |
| debian1 | RUNNING | (eth0) | 2405:6580:2cc0:100:216:3eff:fe16:2801 (eth0) | PERSISTENT | 0 |

Thank you so much!

The only question I have now is: How do we maintain the TeamViewer or nomachine application working after the VM being converted to a container?

When I run the OS in VirtualBox works perfectly but as LXC I don’t get the window mamager to work or basically there is something missing for me to have the same functionality as in a VM.

Thank you in advance for your input in advance!

(Stéphane Graber) #11

I don’t know about teamviewer/nomachine. I suspect they may be tied to somehow having a display attached to the system where they can render, which would be missing in a container?

You may need to tweak some init scripts or configurations to have them start on a headless system.

(Jair Bolivar) #12


I see. headless, that is the vocabulary I am looking for to investigate how to make them work. Of course, the majority of the containers I will be using will not be running a graphical window manager like GNOME or XFCE, but sometimes I would like to have that option.

I will investigate further. Thank you again!

(Markus Heckmann) #13

In ubuntu xenial compiling fails. Care to help? Thx

go get
go/src/ undefined: runtime.KeepAlive
go/src/ undefined: runtime.KeepAlive

(VeFi_2018) #14

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)