2024年10月30日 星期三

如何確認 Wayland 或 X11

echo $XDG_SESSION_TYPE

loginctl show-session $(loginctl | grep $(whoami) | awk '{print $1}') -p Type

For Wayland:
ps aux | grep [w]ayland

For X11:
ps aux | grep [X]

WSL 無法執行 Systemd

錯誤訊息
System has not been booted with systemd as init system (PID 1). Can't operate.

編輯 /etc/wsl.conf 添加以下內容:
[boot]
systemd=true

2024年10月23日 星期三

Proxmox VE qm 設定 額外參數範例

qm set 200 --args "-device e1000,mac=AA:AA:AA:AA:AA:AA,netdev=net1,bus=pci.0,addr=0x13,id=net1,bootindex=100 -netdev user,id=net1,net=192.168.128.0/24,tftp=/tmp/ipxe,bootfile=/autoexec.ipxe"

Proxmox VE hookscript 範例

#!/bin/bash
# Exmple hook script for PVE guests (hookscript config option)
# You can set this via pct/qm with
# pct set <vmid> -hookscript <volume-id>
# qm set <vmid> -hookscript <volume-id>
# where <volume-id> has to be an executable file in the snippets folder
# of any storage with directories e.g.:
# qm set 100 -hookscript local:snippets/hookscript.sh
# chmod a+x /var/lib/vz/snippets/hookscript.sh
# $1 vmid
# $2 status

[ "$2" = "pre-start"  ]&& { date +"%Y-%m-%d %H:%M:%S $1 pre-start" >>/tmp/d;exit 0; }
[ "$2" = "post-start" ]&& { date +"%Y-%m-%d %H:%M:%S $1 post-start">>/tmp/d;exit 0; }
[ "$2" = "pre-stop"   ]&& { date +"%Y-%m-%d %H:%M:%S $1 pre-stop"  >>/tmp/d;exit 0; }
[ "$2" = "post-stop"  ]&& { date +"%Y-%m-%d %H:%M:%S $1 post-stop" >>/tmp/d;exit 0; }

exit 0


解開 proxmox ve 8.x initrd

 zstd -d initrd.img -c |cpio -idm

ipxe + BIOS + UEFI

TFTP server ip 
192.168.9.200

dnsmasq pxe 設定參考
dhcp-option=vendor:PXEClient,6,2b

dhcp-no-override
dhcp-match=set:ipxe-http,175,19
dhcp-match=set:ipxe-https,175,20
dhcp-match=set:ipxe-menu,175,39
dhcp-match=set:ipxe-pxe,175,33
dhcp-match=set:ipxe-bzimage,175,24
dhcp-match=set:ipxe-iscsi,175,17
dhcp-match=set:ipxe-efi,175,36

tag-if=set:ipxe-ok,tag:ipxe-http,tag:ipxe-menu,tag:ipxe-iscsi,tag:ipxe-pxe,tag:ipxe-bzimage
tag-if=set:ipxe-ok,tag:ipxe-http,tag:ipxe-menu,tag:ipxe-iscsi,tag:ipxe-efi

pxe-service=tag:!ipxe-ok,X86PC,BIOS,o/undionly.kpxe,192.168.9.200
pxe-service=tag:!ipxe-ok,IA32_EFI,IA32_EFI,o/snponlyx32.efi,192.168.9.200
pxe-service=tag:!ipxe-ok,BC_EFI,BC_EFI,o/ipxe.efi,192.168.9.200
pxe-service=tag:!ipxe-ok,X86-64_EFI,EFI,o/ipxe.efi,192.168.9.200
pxe-service=tag:!ipxe-ok,X86-64_EFI,EFI0,o/ipxe.efi,192.168.9.200
pxe-prompt=EFI,0

#pxe-service=0, "PXELINUX (0000-BIOS)", "bios/lpxelinux.0"
#pxe-service=1, "PXELINUX (0001-EFI)", "efi64/syslinux.efi"
#pxe-service=2, "PXELINUX (0002-EFI)", "efi64/syslinux.efi"
#pxe-service=3, "PXELINUX (0003-EFI)", "efi64/syslinux.efi"
#pxe-service=4, "PXELINUX (0004-EFI)", "efi64/syslinux.efi"
#pxe-service=5, "PXELINUX (0005-EFI)", "efi64/syslinux.efi"
#pxe-service=6, "PXELINUX (0006-EFI)", "efi64/syslinux.efi"
#pxe-service=7, "PXELINUX (0007-EFI)", o/ipxe.efi,192.168.9.200
#pxe-service=8, "PXELINUX (0008-EFI)", "efi64/syslinux.efi"
#pxe-service=9, "PXELINUX (0009-EFI)", "efi64/syslinux.efi"

#dhcp-boot=tag:ipxe-ok,o/autoexec.ipxe,pxeserver,192.168.9.200
#dhcp-boot=tag:ipxe-ok,http://192.168.9.200/tftp/o/autoexec.ipxe,,
dhcp-boot=tag:ipxe-ok,o/autoexec.ipxe,pxeserver,192.168.9.200

autoexec.ipxe 參考內容
#!ipxe
sleep 100
config

相關檔案
https://boot.ipxe.org/
https://boot.ipxe.org/ipxe.efi
https://boot.ipxe.org/undionly.kpxe
https://boot.ipxe.org/snponly.efi

Windows 11 安裝略過網路設定、使用本機帳號

 Shift + F10 命令提示字元的視窗 

輸入 oobe\bypassnro