[SOLVED] Import packer lxc : unable to create - unable to detect OS distribution

unam

Member
Nov 21, 2019
14
1
23
36
Hi there,
We are using packer to build rootfs to deploy appliances on our proxmox servers for lxc and docker.

I tried to create a container based on an imported rootfs with folowing command line
Code:
pct create 999 /var/lib/vz/template/cache/packer-debian-template.tar.gz --arch amd64 --hostname packer-debian-stretch --rootfs lv_thin_builds:10 --memory 2048 --cores 2

And here is the output of the command
Code:
  Logical volume "vm-999-disk-0" created.
mke2fs 1.44.5 (15-Dec-2018)
Discarding device blocks: done                          
Creating filesystem with 2621440 4k blocks and 655360 inodes
Filesystem UUID: 02db939c-432d-4d46-96bb-3330f7352119
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done                          
Writing inode tables: done                          
Creating journal (16384 blocks): done
Multiple mount protection is enabled with update interval 5 seconds.
Writing superblocks and filesystem accounting information: done

extracting archive '/var/lib/vz/template/cache/packer-debian-template.tar.gz'
Total bytes read: 1321543680 (1.3GiB, 182MiB/s)
  Logical volume "vm-999-disk-0" successfully removed
unable to create CT 999 - unable to detect OS distribution

Question : Do i miss something to provide os information to pct tool ? Is there any file in our "template" we should populate to make the creation ok ?
Files such as /etc/os-relase or /etc/lsb_release are provided and full of complete informations.

Thanks for answer
 
hi,

try setting --ostype debian
 
It does not work :/

Would you have any other idea ?

Regards,

you can try to set --ostype unmanaged for now to get the container started.

the issue is that PVE doesn't know which linux distribution is running inside the CT until it's told to check for something specific (like debian, ubuntu, arch etc.)

this is usually set while creating the container. setting it to unmanaged will skip this and probably boot the container.

afterwards you can try to make it compatible.

check the code here[0] to see what we check for different distributions.

/etc/lsb_release

also i think should be /etc/lsb-release (with dash instead of underscore)

[0]: https://git.proxmox.com/?p=pve-cont...=a0745b47d2ba43fc8c301296b296e1a7ed1e2304#l55
 
  • Like
Reactions: unam
The two solutions are finally working like a charm.

For the second one, I just had to edit the configuration with

Code:
pct set 999 --ostype debian

Thanks again.
 
glad to be of help
 

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!