virtualbox-guest-modules are build-in in virtualbox-host-modules #7

Closed
opened 2021-06-10 13:27:50 +00:00 by pheiduck · 3 comments
pheiduck commented 2021-06-10 13:27:50 +00:00 (Migrated from gitlab2.manjaro.org)

Update fix virtualbox-guest-modules to virtualbox-host-modules because Guest-Modules are now built-in.

# mhwd Driver Config

NAME="video-virtualmachine"
INFO="X.org vmware video driver and open-vm-tools/virtualbox tools"
VERSION="2021.06.10"
FREEDRIVER="true"
PRIORITY="2"

CLASSIDS="0300"
# Virtualbox version 6.0 uses VMSVGA on Linux guests by default, which has VMWare's VENDORID.
# VENDOR VMWare=80ee Virtualbox=15AD Redhat(QXL)=1af4 Redhat(VirtIO)=1b36
VENDORIDS="80ee 15AD 1af4 1b36"
DEVICEIDS="*"

# Dependencies, gtkmm3 is needed to enable copy/paste support with vmware
DEPENDS="virtualbox-guest-utils xf86-video-vmware open-vm-tools xf86-input-vmmouse spice-vdagent"
OPTREMDEPENDS="gtkmm3"
DEPKMOD="virtualbox-host-modules"

XDGAUTOSTARTFILE="/etc/xdg/autostart/mhwd-vmsvga-alert.desktop"
MHWDALERTSCRIPT="/var/lib/mhwd/scripts/vmsvga-alert"

autostart()
{
    cat <<EOF > "${MHWDALERTSCRIPT}"
#!/bin/bash
[[ "\$(lspci -nn | grep 'VMware')" != '' ]] && [[ "\$(systemd-detect-virt)" == 'oracle' ]] && notify-send --icon=dialog-warning -u critical -a MHWD "Window Resizing" "Set your Virtualbox Graphics Controller to VBoxSVGA to enable window resizing"
EOF
	cat <<EOF > "${XDGAUTOSTARTFILE}"
[Desktop Entry]
Type=Application
Exec=${MHWDALERTSCRIPT}
X-GNOME-Autostart-enabled=true
X-KDE-autostart-after=panel
EOF
	# Has to be added separately because MHWD thinks this is the config name
	echo Name=MHWD VMSVGA detection >> "${XDGAUTOSTARTFILE}"
	# Set exec
	chmod +x "${MHWDALERTSCRIPT}"
}

gdm_disable_wayland()
{
	if [[ -e /etc/gdm/custom.conf ]]; then
		sed -i -e 's|#WaylandEnable=false|WaylandEnable=false|g' /etc/gdm/custom.conf
	fi
}

post_install()
{
	if [[ "$(systemd-detect-virt)" == "oracle" ]]; then
		# Virtualbox detected

		# Automatically check if Virtualbox is set to VMSVGA mode and tell the user to switch away
		autostart

		if [[ ! -d /run/openrc ]]; then
			# Load kernel modules and sync clock
			systemctl enable --now vboxservice.service
		fi
		# We have to make /dev/vboxuser read-write, otherwise VBoxClient won't be able to connect. This is not done automatically until the next reboot.
		chmod 666 /dev/vboxuser
	else
		# Remove VBox-Client desktop file when not running in virtualbox
		rm -f "/etc/xdg/autostart/vboxclient.desktop"

		if [[ "$(systemd-detect-virt)" == "vmware" ]]; then
			# Vmware detected

			if [[ ! -d /run/openrc ]]; then
				systemctl enable --now vmtoolsd.service
			fi
		else
			# Not virtualbox or vmware. Start spice-vdagentd.socket to auto detect if spice is in use. Otherwise, do nothing.
			systemctl start spice-vdagentd.socket
		fi
	fi
	gdm_disable_wayland
}

post_remove()
{
	if [[ "$(systemd-detect-virt)" == "oracle" ]]; then
		# Virtualbox detected

		rm -f "${XDGAUTOSTARTFILE}"
		rm -f "${MHWDALERTSCRIPT}"

		if [[ ! -d /run/openrc ]]; then
			systemctl disable --now vboxservice.service
		fi
	elif [[ "$(systemd-detect-virt)" == "vmware" ]]; then
		# Vmware detected

		if [[ ! -d /run/openrc ]]; then
			systemctl disable --now vmtoolsd.service
		fi
	fi
}
Update fix virtualbox-guest-modules to virtualbox-host-modules because Guest-Modules are now built-in. ```bash # mhwd Driver Config NAME="video-virtualmachine" INFO="X.org vmware video driver and open-vm-tools/virtualbox tools" VERSION="2021.06.10" FREEDRIVER="true" PRIORITY="2" CLASSIDS="0300" # Virtualbox version 6.0 uses VMSVGA on Linux guests by default, which has VMWare's VENDORID. # VENDOR VMWare=80ee Virtualbox=15AD Redhat(QXL)=1af4 Redhat(VirtIO)=1b36 VENDORIDS="80ee 15AD 1af4 1b36" DEVICEIDS="*" # Dependencies, gtkmm3 is needed to enable copy/paste support with vmware DEPENDS="virtualbox-guest-utils xf86-video-vmware open-vm-tools xf86-input-vmmouse spice-vdagent" OPTREMDEPENDS="gtkmm3" DEPKMOD="virtualbox-host-modules" XDGAUTOSTARTFILE="/etc/xdg/autostart/mhwd-vmsvga-alert.desktop" MHWDALERTSCRIPT="/var/lib/mhwd/scripts/vmsvga-alert" autostart() { cat <<EOF > "${MHWDALERTSCRIPT}" #!/bin/bash [[ "\$(lspci -nn | grep 'VMware')" != '' ]] && [[ "\$(systemd-detect-virt)" == 'oracle' ]] && notify-send --icon=dialog-warning -u critical -a MHWD "Window Resizing" "Set your Virtualbox Graphics Controller to VBoxSVGA to enable window resizing" EOF cat <<EOF > "${XDGAUTOSTARTFILE}" [Desktop Entry] Type=Application Exec=${MHWDALERTSCRIPT} X-GNOME-Autostart-enabled=true X-KDE-autostart-after=panel EOF # Has to be added separately because MHWD thinks this is the config name echo Name=MHWD VMSVGA detection >> "${XDGAUTOSTARTFILE}" # Set exec chmod +x "${MHWDALERTSCRIPT}" } gdm_disable_wayland() { if [[ -e /etc/gdm/custom.conf ]]; then sed -i -e 's|#WaylandEnable=false|WaylandEnable=false|g' /etc/gdm/custom.conf fi } post_install() { if [[ "$(systemd-detect-virt)" == "oracle" ]]; then # Virtualbox detected # Automatically check if Virtualbox is set to VMSVGA mode and tell the user to switch away autostart if [[ ! -d /run/openrc ]]; then # Load kernel modules and sync clock systemctl enable --now vboxservice.service fi # We have to make /dev/vboxuser read-write, otherwise VBoxClient won't be able to connect. This is not done automatically until the next reboot. chmod 666 /dev/vboxuser else # Remove VBox-Client desktop file when not running in virtualbox rm -f "/etc/xdg/autostart/vboxclient.desktop" if [[ "$(systemd-detect-virt)" == "vmware" ]]; then # Vmware detected if [[ ! -d /run/openrc ]]; then systemctl enable --now vmtoolsd.service fi else # Not virtualbox or vmware. Start spice-vdagentd.socket to auto detect if spice is in use. Otherwise, do nothing. systemctl start spice-vdagentd.socket fi fi gdm_disable_wayland } post_remove() { if [[ "$(systemd-detect-virt)" == "oracle" ]]; then # Virtualbox detected rm -f "${XDGAUTOSTARTFILE}" rm -f "${MHWDALERTSCRIPT}" if [[ ! -d /run/openrc ]]; then systemctl disable --now vboxservice.service fi elif [[ "$(systemd-detect-virt)" == "vmware" ]]; then # Vmware detected if [[ ! -d /run/openrc ]]; then systemctl disable --now vmtoolsd.service fi fi } ```
pheiduck commented 2021-06-10 13:48:53 +00:00 (Migrated from gitlab2.manjaro.org)

changed the description

changed the description
philm commented 2021-06-10 16:33:17 +00:00 (Migrated from gitlab2.manjaro.org)
See https://gitlab.manjaro.org/applications/mhwd-db/-/commit/b5f36774eb5d11f533cc97238b1f41f16408c9b8
pheiduck commented 2021-06-10 17:38:28 +00:00 (Migrated from gitlab2.manjaro.org)

LGTM!

LGTM!
pheiduck (Migrated from gitlab2.manjaro.org) closed this issue 2021-07-03 13:20:40 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
applications/mhwd-db#7
No description provided.