Migrate linux bare metal server to proxmox Container

Today I had to migrate a bare metal linux machine to an proxmox lxc container. I googled a bit an found a nice shore tar command in the proxmox forum but I had to add some excludes

cd /

tar -cvpzf backup.tar.gz –exclude=/backup.tar.gz –exclude=/proc –exclude=/dev –exclude=/sys /

Without excluding dev, proc and sys the tar command tried to compress some virtual 128TB Files in the proc file system. In the new container those directories aren’t needed anyway. Next time I don’t need to google this 🙂

The tar.gz can be copied to the template directory of the proxmox server. Afterwards you can deploy an new container with this template. If you get errors extracting the template. you have to uncheck the “Unpriviliged Container”-Box