OpenVZ Import to LXC - open '/bin/sh' failed: No such file or directory

harmonyp

Member
Nov 26, 2020
196
4
23
46
I am attempting to convert from OpenVZ (ploop) to Proxmox LXC

Export:
Code:
vzctl stop 1145 && vzdump 1145 --bwlimit 9999999999999

Import:
Code:
pct restore 2136 /var/lib/vz/dump/vzdump-1145.tar

The following errors are shown

Code:
recovering backed-up configuration from '/var/lib/vz/dump/vzdump-1145.tar'
Formatting '/var/lib/vz/images/2136/vm-2136-disk-0.raw', fmt=raw size=2147483648 0 preallocation=off
Creating filesystem with 5242880 4k blocks and 1310720 inodes
Filesystem UUID: 07378260-471c-4198-8f3e-6d8a69495391
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
restoring '/var/lib/vz/dump/vzdump-1145.tar' now..
extracting archive '/var/lib/vz/dump/vzdump-1145.tar'
Total bytes read: 2623754240 (2.5GiB, 540MiB/s)
Architecture detection failed: open '/bin/sh' failed: No such file or directory

Falling back to amd64.
Use `pct set VMID --arch ARCH` to change.
merging backed-up and given configuration..
###########################################################
Converting OpenVZ configuration to LXC.
Please check the configuration and reconfigure the network.
###########################################################
/etc/os-release file not found and autodetection failed, falling back to 'unmanaged'



tar tf /var/lib/vz/dump/vzdump-1145.tar

Code:
./
./dump/
./.libvirt/
./.libvirt/config.xml
./.lck
./.ve.xml
./fs/
./root.hdd/
./root.hdd/DiskDescriptor.xml
./root.hdd/.statfs
./root.hdd/root.hds
./root.hdd/DiskDescriptor.xml.lck
./scripts/
./.owner
./.ve.layout
./ve.conf
./.uptime
./etc/
./etc/vzdump/
./etc/vzdump/vps.conf

Attempting to start throws

pct start 2136 --debug
Code:
sync_wait: 36 An error occurred in another process (expected sequence number 7)
__lxc_start: 2073 Failed to spawn container "2136"
script_argv:332 - Executing script "/usr/share/lxc/hooks/lxc-pve-prestart-hook" for container "2136", config section "lxc"
DEBUG    terminal - terminal.c:lxc_terminal_peer_default:665 - No such device - The process does not have a controlling terminal
DEBUG    seccomp - seccomp.c:parse_config_v2:656 - Host native arch is [3221225534]
INFO     seccomp - seccomp.c:parse_config_v2:807 - Processing "reject_force_umount  # comment this to allow umount -f;  not recommended"
INFO     seccomp - seccomp.c:do_resolve_add_rule:524 - Set seccomp rule to reject force umounts
INFO     seccomp - seccomp.c:do_resolve_add_rule:524 - Set seccomp rule to reject force umounts
INFO     seccomp - seccomp.c:do_resolve_add_rule:524 - Set seccomp rule to reject force umounts
INFO     seccomp - seccomp.c:parse_config_v2:807 - Processing "[all]"
INFO     seccomp - seccomp.c:parse_config_v2:807 - Processing "kexec_load errno 1"
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding native rule for syscall[246:kexec_load] action[327681:errno] arch[0]
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[246:kexec_load] action[327681:errno] arch[1073741827]
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[246:kexec_load] action[327681:errno] arch[1073741886]
INFO     seccomp - seccomp.c:parse_config_v2:807 - Processing "open_by_handle_at errno 1"
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding native rule for syscall[304:open_by_handle_at] action[327681:errno] arch[0]
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[304:open_by_handle_at] action[327681:errno] arch[1073741827]
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[304:open_by_handle_at] action[327681:errno] arch[1073741886]
INFO     seccomp - seccomp.c:parse_config_v2:807 - Processing "init_module errno 1"
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding native rule for syscall[175:init_module] action[327681:errno] arch[0]
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[175:init_module] action[327681:errno] arch[1073741827]
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[175:init_module] action[327681:errno] arch[1073741886]
INFO     seccomp - seccomp.c:parse_config_v2:807 - Processing "finit_module errno 1"
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding native rule for syscall[313:finit_module] action[327681:errno] arch[0]
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[313:finit_module] action[327681:errno] arch[1073741827]
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[313:finit_module] action[327681:errno] arch[1073741886]
INFO     seccomp - seccomp.c:parse_config_v2:807 - Processing "delete_module errno 1"
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding native rule for syscall[176:delete_module] action[327681:errno] arch[0]
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[176:delete_module] action[327681:errno] arch[1073741827]
INFO     seccomp - seccomp.c:do_resolve_add_rule:564 - Adding compat rule for syscall[176:delete_module] action[327681:errno] arch[1073741886]
INFO     seccomp - seccomp.c:parse_config_v2:1017 - Merging compat seccomp contexts into main context
INFO     start - start.c:lxc_init:855 - Container "2136" is initialized
INFO     cgfsng - cgroups/cgfsng.c:cgfsng_monitor_create:1064 - The monitor process uses "lxc.monitor/2136" as cgroup
DEBUG    storage - storage/storage.c:storage_query:233 - Detected rootfs type "dir"
INFO     cgfsng - cgroups/cgfsng.c:cgfsng_payload_create:1172 - The container process uses "lxc/2136/ns" as inner and "lxc/2136" as limit cgroup
INFO     start - start.c:lxc_spawn:1757 - Cloned CLONE_NEWNS
INFO     start - start.c:lxc_spawn:1757 - Cloned CLONE_NEWPID
INFO     start - start.c:lxc_spawn:1757 - Cloned CLONE_NEWUTS
INFO     start - start.c:lxc_spawn:1757 - Cloned CLONE_NEWIPC
INFO     start - start.c:lxc_spawn:1757 - Cloned CLONE_NEWNET
INFO     start - start.c:lxc_spawn:1757 - Cloned CLONE_NEWCGROUP
DEBUG    start - start.c:lxc_try_preserve_namespace:139 - Preserved mnt namespace via fd 20 and stashed path as mnt:/proc/25431/fd/20
DEBUG    start - start.c:lxc_try_preserve_namespace:139 - Preserved pid namespace via fd 21 and stashed path as pid:/proc/25431/fd/21
DEBUG    start - start.c:lxc_try_preserve_namespace:139 - Preserved uts namespace via fd 22 and stashed path as uts:/proc/25431/fd/22
DEBUG    start - start.c:lxc_try_preserve_namespace:139 - Preserved ipc namespace via fd 23 and stashed path as ipc:/proc/25431/fd/23
DEBUG    start - start.c:lxc_try_preserve_namespace:139 - Preserved net namespace via fd 24 and stashed path as net:/proc/25431/fd/24
DEBUG    start - start.c:lxc_try_preserve_namespace:139 - Preserved cgroup namespace via fd 25 and stashed path as cgroup:/proc/25431/fd/25
WARN     cgfsng - cgroups/cgfsng.c:cgfsng_setup_limits_legacy:2743 - Invalid argument - Ignoring legacy cgroup limits on pure cgroup2 system
INFO     cgfsng - cgroups/cgfsng.c:cgfsng_setup_limits:2851 - Limits for the unified cgroup hierarchy have been setup
DEBUG    conf - conf.c:lxc_mount_rootfs:1394 - Mounted rootfs "/var/lib/lxc/2136/rootfs" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs" with options "(null)"
INFO     conf - conf.c:setup_utsname:846 - Set hostname to "xs7.oonsppr.org"
INFO     conf - conf.c:mount_autodev:1182 - Preparing "/dev"
INFO     conf - conf.c:mount_autodev:1242 - Prepared "/dev"
DEBUG    conf - conf.c:lxc_mount_auto_mounts:725 - No such file or directory - Tried to ensure procfs is unmounted
DEBUG    conf - conf.c:lxc_mount_auto_mounts:740 - No such file or directory - Tried to ensure sysfs is unmounted
DEBUG    conf - conf.c:mount_entry:2116 - Remounting "/sys/fs/fuse/connections" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/sys/fs/fuse/connections" to respect bind or remount options
DEBUG    conf - conf.c:mount_entry:2135 - Flags for "/sys/fs/fuse/connections" were 4110, required extra flags are 14
DEBUG    conf - conf.c:mount_entry:2179 - Mounted "/sys/fs/fuse/connections" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/sys/fs/fuse/connections" with filesystem type "none"
DEBUG    cgfsng - cgroups/cgfsng.c:__cgroupfs_mount:1576 - Mounted cgroup filesystem cgroup2 onto 22((null))
INFO     conf - conf.c:run_script_argv:332 - Executing script "/usr/share/lxcfs/lxc.mount.hook" for container "2136", config section "lxc"
INFO     conf - conf.c:run_script_argv:332 - Executing script "/usr/share/lxc/hooks/lxc-pve-autodev-hook" for container "2136", config section "lxc"
INFO     conf - conf.c:lxc_fill_autodev:1279 - Populating "/dev"
DEBUG    conf - conf.c:lxc_fill_autodev:1288 - Created device node "full"
DEBUG    conf - conf.c:lxc_fill_autodev:1288 - Created device node "null"
DEBUG    conf - conf.c:lxc_fill_autodev:1288 - Created device node "random"
DEBUG    conf - conf.c:lxc_fill_autodev:1288 - Created device node "tty"
DEBUG    conf - conf.c:lxc_fill_autodev:1288 - Created device node "urandom"
DEBUG    conf - conf.c:lxc_fill_autodev:1288 - Created device node "zero"
INFO     conf - conf.c:lxc_fill_autodev:1363 - Populated "/dev"
INFO     conf - conf.c:lxc_transient_proc:3196 - Caller's PID is 1; /proc/self points to 1
DEBUG    conf - conf.c:lxc_setup_ttydir_console:1856 - Created directory for console and tty devices at "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/lxc"
DEBUG    conf - conf.c:lxc_setup_ttydir_console:1898 - Mounted "/dev/pts/1" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/lxc/console"
DEBUG    conf - conf.c:lxc_setup_ttydir_console:1912 - Mounted "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/lxc/console" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/console"
DEBUG    conf - conf.c:lxc_setup_ttydir_console:1914 - Console has been setup under "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/lxc/console" and mounted to "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/console"
DEBUG    conf - conf.c:lxc_setup_devpts_child:1679 - Mount new devpts instance with options "gid=5,newinstance,ptmxmode=0666,mode=0620,max=1024"
DEBUG    conf - conf.c:lxc_setup_devpts_child:1707 - Created dummy "/dev/ptmx" file as bind mount target
DEBUG    conf - conf.c:lxc_setup_devpts_child:1712 - Bind mounted "/dev/pts/ptmx" to "/dev/ptmx"
DEBUG    conf - conf.c:lxc_allocate_ttys:1061 - Created tty with ptx fd 8 and pty fd 22
DEBUG    conf - conf.c:lxc_allocate_ttys:1061 - Created tty with ptx fd 23 and pty fd 24
INFO     conf - conf.c:lxc_allocate_ttys:1077 - Finished creating 2 tty devices
DEBUG    conf - conf.c:lxc_setup_ttys:977 - Bind mounted "/dev/pts/0" onto "/dev/lxc/tty1"
DEBUG    conf - conf.c:lxc_setup_ttys:977 - Bind mounted "/dev/pts/1" onto "/dev/lxc/tty2"
INFO     conf - conf.c:lxc_setup_ttys:1025 - Finished setting up 2 /dev/tty<N> device(s)
INFO     conf - conf.c:setup_personality:1742 - Set personality to "0lx0"
DEBUG    conf - conf.c:setup_caps:2635 - Dropped mac_admin (33) capability
DEBUG    conf - conf.c:setup_caps:2635 - Dropped mac_override (32) capability
DEBUG    conf - conf.c:setup_caps:2635 - Dropped sys_time (25) capability
DEBUG    conf - conf.c:setup_caps:2635 - Dropped sys_module (16) capability
DEBUG    conf - conf.c:setup_caps:2635 - Dropped sys_rawio (17) capability
DEBUG    conf - conf.c:setup_caps:2638 - Capabilities have been setup
NOTICE   conf - conf.c:lxc_setup:3756 - The container "2136" is set up
INFO     apparmor - lsm/apparmor.c:apparmor_process_label_set_at:1186 - Set AppArmor label to "lxc-2136_</var/lib/lxc>//&:lxc-2136_<-var-lib-lxc>:"
INFO     apparmor - lsm/apparmor.c:apparmor_process_label_set:1231 - Changed AppArmor profile to lxc-2136_</var/lib/lxc>//&:lxc-2136_<-var-lib-lxc>:
NOTICE   utils - utils.c:lxc_drop_groups:1345 - Dropped supplimentary groups
NOTICE   start - start.c:start:2159 - Exec'ing "/sbin/init"
ERROR    start - start.c:start:2162 - No such file or directory - Failed to exec "/sbin/init"
ERROR    sync - sync.c:sync_wait:36 - An error occurred in another process (expected sequence number 7)
DEBUG    network - network.c:lxc_delete_network:4180 - Deleted network devices
ERROR    start - start.c:__lxc_start:2073 - Failed to spawn container "2136"
WARN     start - start.c:lxc_abort:1016 - No such process - Failed to send SIGKILL via pidfd 19 for process 25457
startup for container '2136' failed

pveversion -v
Code:
proxmox-ve: 7.1-1 (running kernel: 5.13.19-1-pve)
pve-manager: 7.1-6 (running version: 7.1-6/4e61e21c)
pve-kernel-5.13: 7.1-4
pve-kernel-helper: 7.1-4
pve-kernel-5.11: 7.0-10
pve-kernel-5.4: 6.4-7
pve-kernel-5.13.19-1-pve: 5.13.19-3
pve-kernel-5.11.22-7-pve: 5.11.22-12
pve-kernel-5.11.22-5-pve: 5.11.22-10
pve-kernel-5.4.143-1-pve: 5.4.143-1
ceph-fuse: 14.2.21-1
corosync: 3.1.5-pve2
criu: 3.15-1+pve-1
glusterfs-client: 9.2-1
ifupdown: residual config
ifupdown2: 3.1.0-1+pmx3
ksm-control-daemon: 1.4-1
libjs-extjs: 7.0.0-1
libknet1: 1.22-pve2
libproxmox-acme-perl: 1.4.0
libproxmox-backup-qemu0: 1.2.0-1
libpve-access-control: 7.1-5
libpve-apiclient-perl: 3.2-1
libpve-common-perl: 7.0-14
libpve-guest-common-perl: 4.0-3
libpve-http-server-perl: 4.0-3
libpve-storage-perl: 7.0-15
libqb0: 1.0.5-1
libspice-server1: 0.14.3-2.1
lvm2: 2.03.11-2.1
lxc-pve: 4.0.9-4
lxcfs: 4.0.8-pve2
novnc-pve: 1.2.0-3
proxmox-backup-client: 2.1.2-1
proxmox-backup-file-restore: 2.1.2-1
proxmox-mini-journalreader: 1.2-1
proxmox-widget-toolkit: 3.4-3
pve-cluster: 7.1-2
pve-container: 4.1-2
pve-docs: 7.1-2
pve-edk2-firmware: 3.20210831-2
pve-firewall: 4.2-5
pve-firmware: 3.3-3
pve-ha-manager: 3.3-1
pve-i18n: 2.6-2
pve-qemu-kvm: 6.1.0-2
pve-xtermjs: 4.12.0-1
pve-zsync: 2.2
qemu-server: 7.1-4
smartmontools: 7.2-pve2
spiceterm: 3.2-2
swtpm: 0.7.0~rc1+2
vncterm: 1.7-1
zfsutils-linux: 2.1.1-pve3
 
Last edited:
it seems the resulting backup is not complete? there is no /bin, /var, /lib (and so on) at all...
 
on which version did you create those backups? note that restoring old vzdump backups created by PVE should work, but if you are running some other openVZ stack that also has vzdump that might not be compatible..
 
  • Like
Reactions: dcsapak
on which version did you create those backups? note that restoring old vzdump backups created by PVE should work, but if you are running some other openVZ stack that also has vzdump that might not be compatible..
OpenVZ release 7.0.18
it seems the resulting backup is not complete? there is no /bin, /var, /lib (and so on) at all...
How else could I backup the data than vzdump 1145
 
easiest way is probably to create a tar file of the rootfs (you can do this from within the container) and then use that as container template in PVE (to restore using it as backup, you'd also need to put a compatible config file first in the tar archive).
 

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!