Linux
udev rule to handle external monitor hot-plug
Find the right device to hook the rule
# udevadm monitor --property
[...]
KERNEL[875278.966083] change /devices/pci0000:00/0000:00:02.0/drm/card1 (drm)
DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card1
DEVNAME=/dev/dri/card1Create the udev rule
# /etc/udev/rules.d/91-homedock.rules
KERNEL=="card1", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/USER/.Xauthority", RUN+="/usr/bin/home_docked.sh"Script to run on event
I used arandr to generate the appropriate xrandr comands per context.
# /usr/bin/home_docked.sh
#!/bin/sh
export DISPLAY=:0
export XAUTHORITY=/home/USER/.Xauthority
MONITOR='DP-2-1-8'
LAPTOP='eDP-1'
MONITOR_STATE=$(xrandr | grep "$MONITOR connected")
if [[ -n $MONITOR_STATE ]]; then
xrandr --output eDP-1 --off --output DP-1 --off --output HDMI-1 --off --output DP-2 --off --output HDMI-2 --off --output DP-2-8 --off --output DP-2-1 --off --output DP-2-1-8 --primary --mode 2560x1440 --pos 0x0 --rotate normal --output DP-2-1-1 --off
else
/usr/bin/xrandr --output $LAPTOP --auto --output $MONITOR --off
fiMinimal Samba share server for Windows VM hosted with incus
https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html
On the Windows host, enable the following parameters (https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/overview-server-message-block-signing)
Create a dummy interface using systemd-networkd
The goal of the dummy interface is to bind services to it instead of local host. Bound services will be available from other resources on the host; such as container or VM.
Last updated
Was this helpful?