Skip to content

Instantly share code, notes, and snippets.

@webwurst
Last active October 30, 2016 03:30
Show Gist options
  • Save webwurst/5119babfbde91bce419a to your computer and use it in GitHub Desktop.
Save webwurst/5119babfbde91bce419a to your computer and use it in GitHub Desktop.
systemd-ubuntu

Basic Information

Manpages on Ubuntu-Website seem to be outdated. Look here instead: Systemd Manpages from Freedesktop

Known Bugs

bug: systemd-importd missing

Versions on Ubuntu Vivid 15.04

$ machinectl --version
systemd 219
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN
$ sudo btrfs subvolume show /var/lib/machines/
/var/lib/machines
	Name: 			machines
	uuid: 			bc977eb3-db74-8f4b-ba2c-83dcd96589ec
	Parent uuid: 		-
	Creation time: 		2015-04-24 13:51:50
	Object ID: 		14097
	Generation (Gen): 	161415
	Gen at creation: 	148024
	Parent: 		257
	Top Level: 		257
	Flags: 			-

Some Hints

Download Machine Images

http://permalink.gmane.org/gmane.comp.sysutils.systemd.devel/28392

Is this a btrfs-only feature? The only hint for this I found is this part of the machinectl-manual: "places them in read-only subvolumes in /var/lib/machines".

How Pantheon Runs Drupal in Linux Containers (But Not Docker!)

http://www.centurylinklabs.com/interviews/running-drupal-in-linux-containers-but-not-docker-on-pantheon/

Example

Debian

$ sudo btrfs subvolume create /var/lib/machines/debian-tree
$ sudo debootstrap --arch=amd64 unstable /var/lib/machines/debian-tree/
$ sudo systemd-nspawn -D /var/lib/machines/debian-tree/

Ubuntu

$ sudo btrfs subvolume create trusty-server-cloudimg-amd64-root
$ sudo tar -xf trusty-server-cloudimg-amd64-root.tar.gz --directory /var/lib/machines/trusty-server-cloudimg-amd64-root
$ sudo systemd-nspawn -M trusty-server-cloudimg-amd64-root

Archlinux

$ sudo btrfs subvolume create /var/lib/machines/archlinux-bootstrap-2015.05.01-x86_64
$ curl -SLO http://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/iso/2015.05.01/archlinux-bootstrap-2015.05.01-x86_64.tar.gz
$ sudo tar -xf archlinux-bootstrap-2015.05.01-x86_64.tar.gz --directory /var/lib/machines/archlinux-bootstrap-2015.05.01-x86_64 --strip-components 1
$ sudo systemd-nspawn -M archlinux-bootstrap-2015.05.01-x86_64

http://seanmcgary.com/posts/run-docker-containers-with-systemd-nspawn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment