Skip to content

Commit

Permalink
Add back service to mount VirtualBox host directory into the guest.
Browse files Browse the repository at this point in the history
Fixes: 770d41f ("Use kernel 5.10 for minikube.iso.")
Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
  • Loading branch information
Francis Laniel committed Aug 12, 2022
1 parent 1bc30be commit 33bc264
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 2 deletions.
1 change: 1 addition & 0 deletions deploy/iso/minikube-iso/arch/x86_64/package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ menu "System tools x86_64"
source "$BR2_EXTERNAL_MINIKUBE_PATH/arch/x86_64/package/cni-plugins/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/arch/x86_64/package/containerd-bin/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/arch/x86_64/package/hyperv-daemons/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/arch/x86_64/package/vbox-mount-service/Config.in"
endmenu
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config BR2_PACKAGE_VBOX_MOUNT_SERVICE
bool "vbox-mount-service"
depends on BR2_x86_64
depends on BR2_LINUX_KERNEL
default y
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# From http://download.virtualbox.org/virtualbox/5.2.42/SHA256SUMS
sha256 e5bee2e34f349aac115ee93974febfe3213ad5e94045fa36b9f04b5f8caa3720 VirtualBox-5.2.42.tar.bz2
sha256 ff784417295e48e3cee80a596faf05e3b0976e1b94d3b88427939912b0c1fc45 VBoxGuestAdditions_5.2.42.iso
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
################################################################################
#
# VirtualBox Mount Service
#
################################################################################
VBOX_MOUNT_SERVICE_VERSION = 5.2.42
VBOX_MOUNT_SERVICE_SITE = http://download.virtualbox.org/virtualbox/$(VBOX_MOUNT_SERVICE_VERSION)
VBOX_MOUNT_SERVICE_LICENSE = GPLv2
VBOX_MOUNT_SERVICE_LICENSE_FILES = COPYING
VBOX_MOUNT_SERVICE_SOURCE = VirtualBox-$(VBOX_MOUNT_SERVICE_VERSION).tar.bz2
VBOX_MOUNT_SERVICE_EXTRA_DOWNLOADS = http://download.virtualbox.org/virtualbox/${VBOX_MOUNT_SERVICE_VERSION}/VBoxGuestAdditions_${VBOX_MOUNT_SERVICE_VERSION}.iso

define VBOX_MOUNT_SERVICE_USERS
- -1 vboxsf -1 - - - - -
endef

define VBOX_MOUNT_SERVICE_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 \
$(VBOX_MOUNT_SERVICE_PKGDIR)/vbox-mount-service.service \
$(TARGET_DIR)/usr/lib/systemd/system/vbox-mount-service.service

ln -fs /usr/lib/systemd/system/vbox-mount-service.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/vbox-mount-service.service
endef

define VBOX_MOUNT_SERVICE_BUILD_CMDS
7z x -aoa $(BR2_DL_DIR)/vbox-mount-service/VBoxGuestAdditions_${VBOX_MOUNT_SERVICE_VERSION}.iso -ir'!VBoxLinuxAdditions.run' -o"$(@D)"
sh $(@D)/VBoxLinuxAdditions.run --noexec --target $(@D)
tar --overwrite -C $(@D) -xjf $(@D)/VBoxGuestAdditions-amd64.tar.bz2 sbin/VBoxService
endef

define VBOX_MOUNT_SERVICE_INSTALL_TARGET_CMDS
$(INSTALL) -Dm755 \
$(@D)/sbin/VBoxService \
$(TARGET_DIR)/sbin
endef

$(eval $(generic-package))
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=VirtualBox Mount Service
ConditionVirtualization=oracle

[Service]
ExecStartPre=-/usr/sbin/modprobe vboxguest
ExecStartPre=-/usr/sbin/modprobe vboxsf

# Normally, VirtualBox only syncs every 20 minutes. This syncs on start, and
# forces an immediate sync if VM time is over 5 seconds off.
ExecStart=/usr/sbin/VBoxService -f --disable-automount --timesync-set-start --timesync-set-threshold 5000

[Install]
WantedBy=multi-user.target
2 changes: 0 additions & 2 deletions deploy/iso/minikube-iso/configs/minikube_x86_64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ BR2_PACKAGE_ACPID=y

# Minikube

config BR2_PACKAGE_VBOX_GUEST=y

BR2_OPTIMIZE_2=y
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/minikube/x86_64/patches"
BR2_TOOLCHAIN_BUILDROOT_VENDOR="minikube"
Expand Down

0 comments on commit 33bc264

Please sign in to comment.