Convert Proxmox LXC to a regular VM

in general, you can't without a lot of manual steps (like installing a kernel and bootloader, for a start). it's very often easier to install a fresh VM and just migrate data from the container to it, unless you are well-versed with Linux system administration and all the steps such a migration needs..
 
in general, you can't without a lot of manual steps (like installing a kernel and bootloader, for a start). it's very often easier to install a fresh VM and just migrate data from the container to it, unless you are well-versed with Linux system administration and all the steps such a migration needs..
I have Next Cloud up on LXC and use the LDAP authorization method, as far as I understand, Next Cloud creates a new UID for each client, won’t there be problems with defining files for each client if, for example, the UIDS are updated?
 
you would have to check with nextcloud documentation what steps you need to migrate from one host to another, I don't know and that is not related to PVE..
 
In principle to create a vm from your lxc: (Sorry if i omit something, i am writing this from memory)

1. create a virtual machine with the same distribution, basic install.

2. boot that vm with a LIVE system

3. In the Livesystem mount the filesystem(s) under /target ( mkdir /target; mount /dev/sda2 /target, mount /dev/sda1 /target/boot ... )

4. Stop the services in your LXC (but not ssh) and rsync that to /target
rsync -av --numeric-ids root@LXC:/ /target/ (you might need additional flags for rsync for ACLs and extended attributes)

5. bindmount from your Livesystem and chroot into your synced system:

for i in proc sys dev run ; do mount -o bind /$i /target/$i; done

6. Now you are inside your (cloned lxc) system install kernel and bootloader (apt install linux-image-amd64 grub-pc or grub-efi, depending on what you use, Install Bootloader grub-install /dev/sda , update-grub)

7. Exit chroot exit

8. Unmount Filesystems umount /target/*; umount /target

9. Reboot into system

10. Pray (if religous) ;)
 
Nice tutorial @ubu.


you could also do everything with a stopped container if you have access to the hypervisor.
If you mount it on the host you have the problem with the shifted UID / GIDs in unprivileged containers
 
I have Next Cloud up on LXC and use the LDAP authorization method, as far as I understand, Next Cloud creates a new UID for each client, won’t there be problems with defining files for each client if, for example, the UIDS are updated?
Nextcloud stores ALL files using the webservers/php-fpm's UID.
Nextcloud uses the database to store users / ownerships, as well as the directory structure beneath the data directory (either pointed to by the config or the data within the nextcloud root).
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!