家中 32G 内存 mini pc 上 win11 装了个 vbox, 然后虚拟了 debian12, 通过 docker 部署了以下服务, 并通过 cf 的 tunnel 实现了外部访问(虽然速度慢点, 但是还挺稳定)
portainer
reminder
Kasm
syncthing
immich
nextcloud
vraya
bitwarden
wg-easy
gitea
关键是莫名其妙崩溃了 2 次, 每次都是显示 initramfs 运行 fsck, 大概 10 次可以正常重启,但来不及做复制/快照就彻底崩溃了, 无论如何运行都会显示大量的 drdy err, 以及 I/O error, dev sda, sector 0 op 0x1:(write) flags 0x800 phys_seg 0 prio class 2. 导致都要重装.
现在累了,想请教下除了 vbox, win11 内置的 linux 子系统值得考虑吗? 前提是万一崩溃,是否可以进入镜像读取内部资料?

昨晚折腾了五六个小时, 终于把 hyper-v 跑起来, 新建了个 debian12 虚拟机,把大概 1.5T 的各种文件/图片复制到该虚拟机的 nextcloud/immich 服务下, 目前看起来很稳定.现在只需要解决该虚拟机在宿主机重启后自动起来就万事大吉了.

Vbox 是 virtual box 吗?我觉得 VMware 值得一用,很稳定。我的是 win10 ltsc

该不会是你硬盘有问题吧

#2 应该不是我的硬盘有问题, 因为宿主机 win11 完全正常.

刚最后一次尝试了 fsck, 结果系统起来了, 然后进去后发现 docker 服务起不来, apt update 了下出现了下面各种提示, chown/chmod 都无法解决.root@Kingwayer:~# apt updateHit:1 mirrors.aliyun.com/debian bookworm InReleaseErr:1 mirrors.aliyun.com/debian bookworm InRelease Couldn't create temporary file /tmp/apt.conf.p4zeLu for passing config to apt-keyIgn:2 mirrors.aliyun.com/debian bookworm-updates InRelease Ign:3 mirrors.aliyun.com/debian bookworm-backports InRelease Ign:4 mirrors.aliyun.com/debian-security bookworm-security InRelease Ign:5 download.webmin.com/download/newkey/repository stable InRelease Err:6 mirrors.aliyun.com/debian bookworm-updates Release Could not open file /var/lib/apt/lists/partial/mirrors.aliyun.com_debian_dists_bookworm-updates_Release - open (30: Read-only file system) [IP: 118.253.168.243 443]Hit:7 download.webmin.com/download/newkey/repository stable ReleaseErr:8 download.webmin.com/download/newkey/repository stable Release.gpg Couldn't create temporary file /tmp/apt.conf.SYbPnO for passing config to apt-keyErr:9 mirrors.aliyun.com/debian bookworm-backports Release Could not open file /var/lib/apt/lists/partial/mirrors.aliyun.com_debian_dists_bookworm-backports_Release - open (30: Read-only file system) [IP: 218.77.199.221 443]Err:10 mirrors.aliyun.com/debian-security bookworm-security Release Could not open file /var/lib/apt/lists/partial/mirrors.aliyun.com_debian-security_dists_bookworm-security_Release - open (30: Read-only file system) [IP: 106.227.100.203 443]Ign:11 download.docker.com/linux/debian bookworm InReleaseErr:12 apt.syncthing.net syncthing InRelease 416 Requested Range Not Satisfiable [IP: 143.244.196.6 443]Err:13 download.docker.com/linux/debian bookworm Release Could not open file /var/lib/apt/lists/partial/download.docker.com_linux_debian_dists_bookworm_Release - open (30: Read-only file system) [IP: 108.138.7.18 443]can't create /var/cache/apt-show-versions/apackages-multiarch: Read-only file system at /usr/bin/apt-show-versions line 280.Reading package lists... DoneW: Not using locking for read only lock file /var/lib/apt/lists/lockW: chmod 0755 of directory /var/lib/apt/lists/auxfiles failed - SetupAPTPartialDirectory (30: Read-only file system)W: chown to _apt:root of directory /var/lib/apt/lists/auxfiles failed - SetupAPTPartialDirectory (30: Read-only file system)W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (30: Read-only file system)W: chown to _apt:root of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (30: Read-only file system)W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.88taf3 - IsAccessibleBySandboxUser (30: Read-only file system)W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.DSaK7h - IsAccessibleBySandboxUser (30: Read-only file system)W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.t5lnUU - IsAccessibleBySandboxUser (30: Read-only file system)W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.UHCUu7 - IsAccessibleBySandboxUser (30: Read-only file system)W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.07rXLV - IsAccessibleBySandboxUser (30: Read-only file system)W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.AtS26j - IsAccessibleBySandboxUser (30: Read-only file system)W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.Sl8MaR - IsAccessibleBySandboxUser (30: Read-only file system)W: chown to _apt:root of file /var/lib/apt/lists/partial/apt.syncthing.net_dists_syncthing_InRelease failed - Item::QueueURI (30: Read-only file system)W: chmod 0600 of file /var/lib/apt/lists/partial/apt.syncthing.net_dists_syncthing_InRelease failed - Item::QueueURI (30: Read-only file system)W: Problem unlinking the file /var/lib/apt/lists/partial/mirrors.aliyun.com_debian_dists_bookworm_InRelease - PrepareFiles (30: Read-only file system)W: chown to _apt:root of file /var/lib/apt/lists/mirrors.aliyun.com_debian_dists_bookworm_InRelease failed - Item::QueueURI (30: Read-only file system)W: chmod 0600 of file /var/lib/apt/lists/mirrors.aliyun.com_debian_dists_bookworm_InRelease failed - Item::QueueURI (30: Read-only file system)W: chown to root:root of file /var/lib/apt/lists/mirrors.aliyun.com_debian_dists_bookworm_InRelease failed - 400::URIFailure (30: Read-only file system)W: chmod 0644 of file /var/lib/apt/lists/mirrors.aliyun.com_debian_dists_bookworm_InRelease failed - 400::URIFailure (30: Read-only file system)W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: mirrors.aliyun.com/debian bookworm InRelease: Couldn't create temporary file /tmp/apt.conf.p4zeLu for passing config to apt-key

win 自带的 hyper-v 就很够用,跑 debian 几个月稳定

为什么不用 Hyper-V 呢?

#5 #ysc3839 hper-v 没问题啊, 关键是如果虚拟机死了, 镜像文件能进去吗? 或者有完善的修复轮子吗?此外, 听说 hpver-v 比较耗费资源?

镜像文件当然要用对应的软件来读取解析,如果需要读取,最好的办法是专门划分一个逻辑分区然后直通给虚拟机。这样宿主和虚拟机都可以读写这个分区。hyper-v 是 1 类虚拟机,不会更消耗资源。

VirtualBox 7.0.16 版本不要升级,会导致 Windows 蓝屏 /t/1033367

卡 fsck 不是盘有问题就是 virtio 有问题。。。现有的数据恢复或者提取工具如果能处理 vitrualbox 的 vdi 那么他一定可以处理微软的 vhd 或 vhdx ,毕竟后者显然更加通用。。。

vhdx 可以直接挂载成磁盘到你的 Windows 系统,访问方式和普通磁盘分区没差

#8 开启了 hyper-V, 有个问题新检查的 VM 拿不到内网 ip 地址, 已经为它启用了个交换机, 使用的是外部网络且和 win11 宿主机同样的网卡, 请问会是哪些地方问题呢?

#8 搞定了, 原来 hyper-V 的虚拟机需要指定交换机/网卡.

你这个错误是硬盘 IO 错误,virtual box 一直用,小 bug 有,但还是算稳定,你这个要把硬盘控制器配置成 virtio,如果主机是固态硬盘,一定要把虚拟机也配置成固态。

如果你没有 GUI 和特定硬件需求首先考虑 hyper-v

#7 说反了吧,hyper-v 是裸金属虚拟化,效率是最高的

hyper-v 会让 host 效率降低没错就是但是对于日常用,vmware 是更好的选择vbox 真的不建议用

无桌面需求,hyper-v 在 win 上面是最好的,会有点影响宿主机内存速度,其他影响不大,以前用过开 ubuntu 服务器,运行了几个月都没出过问题

Win11 默认开启基于虚拟化的安全( learn.microsoft.com/zh-cn/windows-hardware/design/device-experiences/oem-vbs ),其实你整个系统都是运行在 Hyper-V 里面,不管你有没有开启它。这个时候第三方的虚拟机软件都是在使用 Hyper-V 兼容 API ,就是在 Hyper-V 引擎上套壳,而不是他们自己的虚拟化引擎,所以不管 VMware 还是 Virtualbox 的 bug 都挺多。你不需要 Virtualbox 的特定功能的话,就用 Hyper-V 好了。

装个 esxi 然后再虚拟机器吧 ………… win 11 本身就不一定稳定 …………

之前 virtualbox 6.x 升级到 7 以后,就各种问题,差点就放弃使用了

最新版本的 vbox 有问题,建议退到 12