V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
KINGWAY
V2EX  ›  程序员

Vbox 下虚拟机第二次崩溃了, 我也崩溃了

  •  
  •   KINGWAY · 12 天前 · 2132 次点击

    家中 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 子系统值得考虑吗? 前提是万一崩溃,是否可以进入镜像读取内部资料?

    第 1 条附言  ·  11 天前
    昨晚折腾了五六个小时, 终于把 hyper-v 跑起来, 新建了个 debian12 虚拟机,把大概 1.5T 的各种文件/图片复制到该虚拟机的 nextcloud/immich 服务下, 目前看起来很稳定.

    现在只需要解决该虚拟机在宿主机重启后自动起来就万事大吉了.
    23 条回复    2024-05-02 23:18:07 +08:00
    winson030
        1
    winson030  
       12 天前 via iPhone
    Vbox 是 virtual box 吗?我觉得 VMware 值得一用,很稳定。我的是 win10 ltsc
    wheat0r
        2
    wheat0r  
       12 天前
    该不会是你硬盘有问题吧
    KINGWAY
        3
    KINGWAY  
    OP
       12 天前
    @wheat0r #2 应该不是我的硬盘有问题, 因为宿主机 win11 完全正常.
    KINGWAY
        4
    KINGWAY  
    OP
       12 天前
    刚最后一次尝试了 fsck, 结果系统起来了, 然后进去后发现 docker 服务起不来, apt update 了下出现了下面各种提示, chown/chmod 都无法解决.
    root@Kingwayer:~# apt update
    Hit:1 https://mirrors.aliyun.com/debian bookworm InRelease
    Err:1 https://mirrors.aliyun.com/debian bookworm InRelease
    Couldn't create temporary file /tmp/apt.conf.p4zeLu for passing config to apt-key
    Ign:2 https://mirrors.aliyun.com/debian bookworm-updates InRelease
    Ign:3 https://mirrors.aliyun.com/debian bookworm-backports InRelease
    Ign:4 https://mirrors.aliyun.com/debian-security bookworm-security InRelease
    Ign:5 https://download.webmin.com/download/newkey/repository stable InRelease
    Err:6 https://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 https://download.webmin.com/download/newkey/repository stable Release
    Err:8 https://download.webmin.com/download/newkey/repository stable Release.gpg
    Couldn't create temporary file /tmp/apt.conf.SYbPnO for passing config to apt-key
    Err:9 https://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 https://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 https://download.docker.com/linux/debian bookworm InRelease
    Err:12 https://apt.syncthing.net syncthing InRelease
    416 Requested Range Not Satisfiable [IP: 143.244.196.6 443]
    Err:13 https://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... Done
    W: Not using locking for read only lock file /var/lib/apt/lists/lock
    W: 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: https://mirrors.aliyun.com/debian bookworm InRelease: Couldn't create temporary file /tmp/apt.conf.p4zeLu for passing config to apt-key
    tux
        5
    tux  
       12 天前
    win 自带的 hyper-v 就很够用,跑 debian 几个月稳定
    ysc3839
        6
    ysc3839  
       12 天前 via Android
    为什么不用 Hyper-V 呢?
    KINGWAY
        7
    KINGWAY  
    OP
       12 天前
    @tux #5 #ysc3839 hper-v 没问题啊, 关键是如果虚拟机死了, 镜像文件能进去吗? 或者有完善的修复轮子吗?

    此外, 听说 hpver-v 比较耗费资源?
    buaacss
        8
    buaacss  
       12 天前
    镜像文件当然要用对应的软件来读取解析,如果需要读取,最好的办法是专门划分一个逻辑分区然后直通给虚拟机。这样宿主和虚拟机都可以读写这个分区。

    hyper-v 是 1 类虚拟机,不会更消耗资源。
    rsy
        9
    rsy  
       12 天前 via Android
    VirtualBox 7.0.16 版本不要升级,会导致 Windows 蓝屏
    /t/1033367
    ntedshen
        10
    ntedshen  
       12 天前
    卡 fsck 不是盘有问题就是 virtio 有问题。。。

    现有的数据恢复或者提取工具如果能处理 vitrualbox 的 vdi 那么他一定可以处理微软的 vhd 或 vhdx ,毕竟后者显然更加通用。。。
    Akkuman
        11
    Akkuman  
       12 天前 via Android
    @KINGWAY vhdx 可以直接挂载成磁盘到你的 Windows 系统,访问方式和普通磁盘分区没差
    KINGWAY
        12
    KINGWAY  
    OP
       12 天前
    @buaacss #8 开启了 hyper-V, 有个问题新检查的 VM 拿不到内网 ip 地址, 已经为它启用了个交换机, 使用的是外部网络且和 win11 宿主机同样的网卡, 请问会是哪些地方问题呢?
    KINGWAY
        13
    KINGWAY  
    OP
       12 天前
    @buaacss #8 搞定了, 原来 hyper-V 的虚拟机需要指定交换机/网卡.
    flynaj
        14
    flynaj  
       12 天前 via Android
    你这个错误是硬盘 IO 错误,virtual box 一直用,小 bug 有,但还是算稳定,你这个要把硬盘控制器配置成 virtio,如果主机是固态硬盘,一定要把虚拟机也配置成固态。
    kenvix
        15
    kenvix  
       12 天前
    如果你没有 GUI 和特定硬件需求首先考虑 hyper-v
    kenvix
        16
    kenvix  
       12 天前
    @KINGWAY #7 说反了吧,hyper-v 是裸金属虚拟化,效率是最高的
    Admstor
        17
    Admstor  
       11 天前
    hyper-v 会让 host 效率降低没错就是

    但是对于日常用,vmware 是更好的选择
    vbox 真的不建议用
    livepps
        18
    livepps  
       11 天前 via Android
    无桌面需求,hyper-v 在 win 上面是最好的,会有点影响宿主机内存速度,其他影响不大,以前用过开 ubuntu 服务器,运行了几个月都没出过问题
    billccn
        19
    billccn  
       11 天前
    Win11 默认开启基于虚拟化的安全( https://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 好了。
    petercui
        20
    petercui  
       11 天前
    装个 esxi 然后再虚拟机器吧 ………… win 11 本身就不一定稳定 …………
    FrankAdler
        21
    FrankAdler  
       11 天前
    之前 virtualbox 6.x 升级到 7 以后,就各种问题,差点就放弃使用了
    euph
        22
    euph  
       11 天前 via Android
    最新版本的 vbox 有问题,建议退到 12
    sstutu
        23
    sstutu  
       13 小时 57 分钟前
    zhong'zhaozhongzhao
    @euph 中招了,确实 12 版本没问题
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2180 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 05:15 · PVG 13:15 · LAX 22:15 · JFK 01:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.