别用 Hyper-V 第二代虚拟机安装加密磁盘的 Debian

昨晚尝试用安装全盘加密的 Debian 虚拟机,安装时一切正常,装完后启动发现无法输入磁盘密码,导致无法启动。网上搜索一番,发现是 Debian 在解密磁盘时还没加载 Hyper-V 的键盘驱动,导致无法输入:

Because Generation 2 virtual machines in Hyper-V are presented with a minimal set of EFI hardware, the kernel module “hyperv_keyboard” must be present to interact with the console keyboard. On systems with disk encryption, the user will be prompted for the key to decrypt the disk, but cannot enter the password because no keyboard driver is present.

此问题不仅在 Debian 存在:

可能还有些其他 Linux 发行版存在这种问题。当然也有解决办法:

You would have to boot the installer > then chroot into the installed system ( wherever the root filesystem is in hyper-V) and then edit /etc/initramfs-tools/modules

但我不知道怎么 chroot into... ,遂作罢。

还看到解决问题的代码已经 merge 到代码库中,于是下载了新的 Debian 12.6 的镜像,重新装了一个,启动后依然无法输入磁盘密码,看来只是合并进了代码库中,还没发布到版本中。

所以对于不了解 Linux 启动或者对 Linux 并没有那么熟练的的 Hyper-V 用户来说,还是用 Hyper-V 第一代虚拟机吧,实测没问题。

《别用 Hyper-V 第二代虚拟机安装加密磁盘的 Debian》有一个想法

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注