C
C
comper2019-10-30 11:02:54
linux
comper, 2019-10-30 11:02:54

How to migrate Linux server to LXC container?

Hello friends!
Tell me how to correctly transfer a Linux server to an LXC container on Proxmox?
Tried so.
-Created a container.
- minted the FS
pct mount 100
- merged files from the old server

rsync -avz -H -X --one-file-system --numeric-ids --exclude-from=/tmp/exclude.txt -e ssh [email protected]:/ /var/lib/lxc/100/rootfs/

in exceptions
/tmp
/boot
/lib/modules
/etc/blkid
/etc/mtab
/etc/lvm
/etc/fstab

pct unmount 100

-I'm trying to run it. Nothing works. In the console, the cursor just blinks.
Tried all sorts of manipulations that did not change anything. Type
chroot /var/lib/lxc/100/rootfs/ 
apt-get --yes -o  Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" remove grub grub2 grub-pc grub-common linux-image-amd64

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Dmitriev, 2019-10-30
@SignFinder

Apparently - lxc-convert -p needs to be done after copying.
In general, a bunch of instructions are googled like this https://github.com/deimosfr/lxc-convert for the phrase "physical server to LXC"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question