tests/virtualbox: Start systemwide DBus in guests.

We want to check whether DBus functionality is working, so let's make
sure it is running in our mini-initrd.

DBus unfortunately requires to have users properly set up and another
configuration file other than in ${dbus.daemon}/etc/dbus-1/system.conf,
so we do provide that as well.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>

aszlig 7707c7df 89b6831f

Changed files
+13
nixos
+13
nixos/tests/virtualbox.nix
···
#!${pkgs.stdenv.shell} -xe
export PATH="${pkgs.coreutils}/bin:${pkgs.utillinux}/bin"
+
mkdir -p /etc/dbus-1 /var/run/dbus
+
cat > /etc/passwd <<EOF
+
root:x:0:0::/root:/bin/false
+
messagebus:x:1:1::/var/run/dbus:/bin/false
+
EOF
+
cat > /etc/group <<EOF
+
root:x:0:
+
messagebus:x:1:
+
EOF
+
cp -v "${pkgs.dbus.daemon}/etc/dbus-1/system.conf" \
+
/etc/dbus-1/system.conf
+
"${pkgs.dbus.daemon}/bin/dbus-daemon" --fork --system
+
${pkgs.linuxPackages.virtualboxGuestAdditions}/bin/VBoxService
${(attrs.vmScript or (const "")) pkgs}