From d9ccc62a872ad2d8810e95e77b21c7b173761ae4 Mon Sep 17 00:00:00 2001 From: Aaron Bull Schaefer Date: Thu, 26 Sep 2013 14:37:20 -0700 Subject: [PATCH] Add vbox guest additions before running mkinitcpio I'm trying to solve the issue of the guest additions not running on the first boot due to the installer kernel being 3.10 and the VM having a newer version. If you reboot the VM after your first `vagrant up` everything works as expected. --- install-virtualbox.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install-virtualbox.sh b/install-virtualbox.sh index f7caef7..3cbceac 100644 --- a/install-virtualbox.sh +++ b/install-virtualbox.sh @@ -44,6 +44,12 @@ echo '==> generating the system configuration script' /usr/bin/install --mode=0755 /dev/null "${TARGET_DIR}${CONFIG_SCRIPT}" cat <<-EOF > "${TARGET_DIR}${CONFIG_SCRIPT}" + # VirtualBox Guest Additions + /usr/bin/pacman -S --noconfirm linux-headers virtualbox-guest-utils virtualbox-guest-dkms + echo -e 'vboxguest\nvboxsf\nvboxvideo' > /etc/modules-load.d/virtualbox.conf + /usr/bin/systemctl start dkms.service + /usr/bin/systemctl enable dkms.service + echo '${FQDN}' > /etc/hostname /usr/bin/ln -s /usr/share/zoneinfo/${TIMEZONE} /etc/localtime echo 'KEYMAP=${KEYMAP}' > /etc/vconsole.conf @@ -57,12 +63,6 @@ cat <<-EOF > "${TARGET_DIR}${CONFIG_SCRIPT}" /usr/bin/sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config /usr/bin/systemctl enable sshd.service - # VirtualBox Guest Additions - /usr/bin/pacman -S --noconfirm linux-headers virtualbox-guest-utils virtualbox-guest-dkms - echo -e 'vboxguest\nvboxsf\nvboxvideo' > /etc/modules-load.d/virtualbox.conf - /usr/bin/systemctl start dkms.service - /usr/bin/systemctl enable dkms.service - # Vagrant-specific configuration /usr/bin/groupadd vagrant /usr/bin/useradd --password ${PASSWORD} --comment 'Vagrant User' --create-home --gid users --groups vagrant vagrant