小明的網誌

一個工程師的故事

By

修改 Debian console 解析度為 640×480 + disable ipv6

緣由

維護 Debian 主機時, 常需要接 KVM/IPKVM, 但若 KVM/IPKVM 有這樣狀況, 無法讓 console 畫面顯示正常, 唯有更改解析度

步驟

  • 修改 /etc/default/grub.d/custom.cfg (含 ipv6)
cat << EOF > /etc/default/grub.d/custom.cfg
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="nomodeset net.ifnames=0"
GRUB_CMDLINE_LINUX="net.ifnames=0"
GRUB_TERMINAL=console
GRUB_GFXMODE=640x480
# keey: graphic mode
# text: text mode
# ref: https://www.gnu.org/software/grub/manual/grub/html_node/Simple-configuration.html#Simple-configuration
GRUB_GFXPAYLOAD_LINUX=text
EOF
  • 修改 /etc/default/grub.d/custom.cfg (不含 ipv6)
    ref: https://www.thegeekdiary.com/how-to-disable-ipv6-on-ubuntu-22-04-lts-jammy-jellyfish/
cat << EOF > /etc/default/grub.d/custom.cfg
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="nomodeset ipv6.disable=1 net.ifnames=0"
GRUB_CMDLINE_LINUX="ipv6.disable=1 net.ifnames=0"
GRUB_TERMINAL=console
GRUB_GFXMODE=640x480
# keey: graphic mode
# text: text mode
# ref: https://www.gnu.org/software/grub/manual/grub/html_node/Simple-configuration.html#Simple-configuration
GRUB_GFXPAYLOAD_LINUX=text
EOF
  • 其中 net.ifnames=0, 讓 interface name 另為 ethX

  • 排除 Warning: os-prober will not be executed to detect other bootable partitions
    ref: https://askubuntu.com/questions/1414245/why-do-i-get-warning-os-prober-will-not-be-executed-to-detect-other-bootable-p

cat << EOF >> /etc/default/grub.d/custom.cfg
GRUB_DISABLE_OS_PROBER=false
EOF

chmod -x /etc/grub.d/30_os-prober
  • 更新 initrd.img 和 grub
update-initramfs -u
update-grub

發表迴響

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料

Verified by MonsterInsights