I installed Windows 11 in Virtual Box in case I need it for school but it keeps crashing. My laptop is 12gb RAM and I gave the VM 8gb RAM.

If I upgrade my laptop RAM to maybe 16gb and give the VM 12gb RAM would that help? Thanks I’m a newb

  • malin
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    7 hours ago

    VMs will crash because of running out of RAM.

    It sounds like that’s exactly what’s happening with your setup, however you probably don’t need to buy more RAM to fix it.

    Type free, or free -h, into a terminal to see how much RAM and swap space is being used.

    Swap is a tool that allows you to use your storage drive as additional RAM when necessary. If nothing indicates swap usage when using free, then you need to enable swap space.

    Ask AI “How do I enable swap on Linux” and it should give you good instructions.

  • gomp@lemmy.ml
    link
    fedilink
    arrow-up
    10
    ·
    2 days ago

    What’s crashing? the Linux host? Virtualbox? the windows guest?

    (personally I won’t be able to help you, but other people might)

    • unicornBro@sh.itjust.worksOP
      link
      fedilink
      arrow-up
      9
      ·
      edit-2
      2 days ago

      First the VM will freeze. Then my whole computer freezes. Then the VM closes and in the Virtual Box menu it says that Windows 11 aborted.

      • njaard@lemmy.world
        link
        fedilink
        arrow-up
        12
        ·
        2 days ago

        This sounds exactly like Linux giving the old OOM killer. Reproduce the problem, then look at the output of sudo dmesg. If it shows something like “OOM killed process”, then yes, that’s the problem.

        Do the following:

        1. Consider giving less memory to the VM
        2. Ensure you have at least a little swap space configured on Linux
        3. Consider getting more memory
        4. Exit other programs on Linux, especially web browsers
  • sylver_dragon@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    2 days ago

    On my system (Arch), if I have too much running, the kernel can kill processes based on resource starvation. It’s quite possible you’re running into a similar limitation. There should be a message in dmesg when this happens.

      • sylver_dragon@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        2 days ago

        No, if you open a terminal and run:
        sudo dmesg

        You should get a long output which is the kernel log. Assuming the crash happened recently, there may be something in the last few lines (bottom of the output) which could indicate why the process died (or was killed). Keep in mind that this is a running log; so, if it’s been a while since the crash, the entries for it may be higher up in the log. It’s often best (if you can) to trigger the problem then immediately go run the sudo dmesg command and look at the output. With luck, there will be useful logs. If not, you may need to look elsewhere.

  • KazuchijouNo@lemy.lol
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 days ago

    I’m also virtualizing windows with kvm/qemu and my laptop’s got 16 G of RAM; I gave the host and the guest 8 GB each and sometimes windows crashes when I’m doing memory intensive stuff on the linux(host) side. (video-rendering, heavy image editing, etc. It once crashed while running a python script with selenium)

    The guest is windows 10 and it triples the host memory usage while idle.

  • merthyr1831@lemmy.ml
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    2 days ago

    I would consider creating a swapfile if you have an SSD. There should be countless tutorials for doing it on Ubuntu.

    It might mean your windows or Ubuntu install gets sluggish, but even 32GB (less than 10% of a typical storage drive!) of spare swap space can let your active and memory-hogging processes breathe instead of invoking the SystemD-OOM killer. Also, it’s essentially free! You’ll benefit from more RAM though.

    For what it’s worth, I think Ubuntu is also fairly aggressive with memory management. I remember complaints that it was a little too hasty to kill user processes under memory-limited scenarios. not sure if that was addressed

  • Viper3210@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    2 days ago

    Hello,

    Others have given good advice on narrowing down the issue. I’ll just say that I don’t think you’ll ever get stability with 8gb for win 11. Ubuntu is going to struggle sometimes with the 4gb left for it too.

    I would look into upgrading the ram first. Old laptop ram can be very cheap. I doubled the memory in a laptop for my mom by adding a 16gb stick I got on eBay for $20.

    If it has an empty slot just buy an exact copy of the module it has and it will probably work. If both slots are occupied you’ll have to do some research to find the correct modules and it might not be worth the money and hassle.

    • vandsjov@feddit.dk
      link
      fedilink
      English
      arrow-up
      1
      ·
      11 hours ago

      I’ll just say that I don’t think you’ll ever get stability with 8gb for win 11

      First, I’ve never tried using Linux as a VM host, so there might be something in play I don’t know about. However, having run Windows 11 as a guest under Windows 11 and macOS, I can push Windows 11 down to 1 GB of RAM With no problems. It’s a little sluggish when opening apps but never unstable. Normally I run it with 4 GB.

  • the_weez@midwest.social
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    2 days ago

    How do you feel about trying Virtual Machine Manager instead? I really prefer it over virtual box, personally. It uses the KVM virtualization built into the Linux kernel instead of needing a module like vbox. If you want to stick with virtual box for some reason, I would make sure that all the drivers are installed on the windows guest, you should really always do that with a VM.

    https://sysguides.com/install-a-windows-11-virtual-machine-on-kvm is a pretty good guide I have followed for VirtManager.

      • haui@lemmy.giftedmc.com
        link
        fedilink
        arrow-up
        2
        ·
        2 days ago

        Oh. I have zero experience with zorin. Ubuntu should ne no problem but i have zero idea what the common pitfalls in zorin are. i5 usually does the job, assuming its not 13 yrs old or something.