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 <[email protected]>", created: 2011-05-28?   [Y/n]
error: key "Tom Gundersen <[email protected]>" 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.

9
  • 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. Apr 16, 2015 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 askubuntu.com/questions/293275/… c) there's no hardware emulation required, you're just changing the mount points. But fair enough. Thanks for your thoughts.
    – Budric
    Apr 16, 2015 at 15:23
  • I think it should be possible. But just to confirm, did you use sudo?
    – muru
    Apr 16, 2015 at 15:34
  • Yes I ran create as root.
    – Budric
    Apr 16, 2015 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? launchpad.net/~thopiekar/+archive/ubuntu/pacman
    – muru
    Apr 16, 2015 at 15:53

0

Browse other questions tagged .