2

I'm trying to create arch linux lxc on Ubuntu 15.04 server.

First: lxc-create -t archlinux -n test fails with errors that pacman and pacstrap could not be found. I solved this by installing pacman using apt, and by unpacking the arch-install-scripts.

Now the create command fails with:

==> Creating install root at /var/lib/lxc/test/rootfs
==> Installing packages to /var/lib/lxc/test/rootfs
no display possible
==> ERROR: Failed to install packages to new root
Failed to install container packages
failed to install Arch Linux
lxc_container: lxccontainer.c: create_run_template: 1108 container creation template for test failed
lxc_container: lxccontainer.c: remove_partial: 196 No such file or directory - Error unlink partial file /var/lib/lxc/test/partial
lxc_container: lxc_create.c: main: 274 Error creating container test

Does anyone have any suggestions?

EDIT

Thanks to muru who pointed out my mistake. I needed pacman - the package manager. I got as far as:

add-apt-repository ppa:thopiekar/pacman
apt-get update
apt-get install -y pacman-pm arch-install-scripts
pacman-key --init

I had problem initializing pacman-key due to not enough entropy so I had to install stress app and run it in the background: stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 1000s while pacman-key was generating keys in the foreground.

I configured some repositories in /etc/pacman.conf

[core]
SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist

[extra]
SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist

/etc/pacman.d/mirrorlist can be generated from list

However the lxc installation fails with importing keys:

:: Import PGP key 2048R/, "Tom Gundersen <teg@jklm.no>", created: 2011-05-28?   [Y/n]
error: key "Tom Gundersen <teg@jklm.no>" could not be imported

I tried:

pacman-key --populate archlinux
==> ERROR: The keyring file /usr/share/pacman/keyrings/archlinux.gpg does not exist.

So I think I'm pretty close to getting it to work, but it doesn't so far. I need to do some reading how package signing works.

Budric
  • 295
  • 2
  • 6
  • 15
  • I don't think you do that. here is an excerpt from the Ubuntu serverguide. "They are more akin to an enhanced chroot than to full virtualization like Qemu or VMware, both because they do not emulate hardware and because containers share the same operating system as the host." I think you need to do a full virtualization. – Doug Smythies Apr 16 '15 at 15:10
  • I just assumed it would work becase: a) the deb package comes with arch template. b) this post suggests I can run different distros http://askubuntu.com/questions/293275/what-is-lxc-and-how-to-get-started c) there's no hardware emulation required, you're just changing the mount points. But fair enough. Thanks for your thoughts. – Budric Apr 16 '15 at 15:23
  • I think it should be possible. But just to confirm, did you use sudo? – muru Apr 16 '15 at 15:34
  • Yes I ran create as root. – Budric Apr 16 '15 at 15:36
  • 1
    Ah.. If you did sudo apt-get install pacman, then what got installed isn't pacman the package manager, but a game named pacman. You'll probably have to manually extract pacman as well. Or maybe this PPA? https://launchpad.net/~thopiekar/+archive/ubuntu/pacman – muru Apr 16 '15 at 15:53
  • I stand corrected, thanks and sorry for the bad information. – Doug Smythies Apr 16 '15 at 16:18
  • I find LXC is i s rapid development and often the scripts to install containers seem to fail. pacman should be installed in the arch container automatically. If it is not, you may wish to try the arch forums for support. – Panther Apr 16 '15 at 17:12
  • @bodhi.zazen some setup still needs to be done from the host machine, I think. For example, the Arch Wiki says you need to install debootstrap if you create a Debian/Ubuntu container, and I suppose the equivalent pacstrap (from arch-install-scripts) needs pacman. – muru Apr 16 '15 at 18:11
  • @muru - it varies with the container and is ever evolving. IMO best thing to do is file a bug report against the LXC scripts to the maintainer of the script(s) can fix it. – Panther Apr 17 '15 at 15:28

0 Answers0