Solved bhyve - poor RAM usage for Windows VM

Hello All!

I've just installed fresh copy of Windows 10 Pro as virtual machine using bhyve.
The issue is Windows does not use more then 2GB of RAM. There is 8GB of RAM available in the system.
I use the following command to run Windows VM. I've even disabled pagefile without success.

IN USE 1,9GB, AVAILABLE 6,1GB. It's not possible that Windows does not need to use more RAM.

bhyve -c sockets=2,cores=4 \
-m 8G \
-H \
-s 0,hostbridge \
-s 3,ahci-hd,/vm/my_vm.img,sectorsize=512 \
-s 10,virtio-net,tap1 \
-s 29,fbuf,tcp=0.0.0.0:5900,wait \
-s 30,xhci,tablet \
-s 31,lpc -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
-w my_vm


Any suggestions?
 
Another issue. I disabled swap file, restarted Windows and memory decreased to 7GB in the system...
Then swap enabled and still 7GB of RAM.
 
I set -m 16G \ and still see 7GB of RAM. The difference is that Windows started to use more RAM. Currently 3GB and more.
It looks like Windows uses more than 2GB of RAM but I still cannot see more then 7GB of RAM.
 
What does the System Information applet show? There is a detailed hardware description and the RAM size should be shown there.
If it displays the proper size that you passed to bhyve, then it's a Windows issue and you should look into a Windows forum.
 
You have written that the system has 8 GB. How do you expect to give the VM 16 when you have only 8 on board?
 
By system I meant Windows. When I was writing the thread the system shown 8GB. After restarts and changes CPU, RAM etc., it shows 7GB and no more.
Hypervisor has got 256 GB of RAM.
 
When you start bhyve, use the program sysutils/htop on the host (install it with "pkg install htop").
What is the memory size you see in the "VIRT" column? That's virtual memory.
Your VM should have about the same amount you passed as a parameter.
 
What I gather from your posts is that you think windows isn't hogging enough RAM. I think 2GB is a whole lot, depending on what you're running. The thing seems to be detecting the 8GB you set aside for it, if you want to test just run a RAM eater script and see if usage goes up.
 
Generally, Windows sees more RAM (up to 7GB as I mentioned), after restarts and changes CPU and RAM. But the next issue is WIndows detects only 7GB of RAM even if I set 8GB, 16GB or 32GB.
I will install fresh copy of Windows 10 again and we will see.
 
Generally, Windows sees more RAM (up to 7GB as I mentioned), after restarts and changes CPU and RAM. But the next issue is WIndows detects only 7GB of RAM even if I set 8GB, 16GB or 32GB.
I will install fresh copy of Windows 10 again and we will see.
Well, if the host OS reports that bhyve is using only 8GB of memory, this is probably how much the guest OS will see. I have no idea why giving it more than 8GB does not work - this needs to be answered by the bhyve experts.
I am looking at a bhyve VM on my machine, which uses 24GB of memory with a GNU/Linux guest OS, so it's not a bhyve limitation for sure.
Here is my config:
Bash:
bhyve -c 16 -m 24G -w -H \
        -s 0,hostbridge \
         \
        -s 3,ahci-hd,/dev/zvol/zroot/iohyve/VMNAME/disk0 \
        -s 5,virtio-net,tap0 \
         \
        -s 30,xhci,tablet \
        -s 31,lpc -l com1,stdio \
        -l bootrom,/iohyve/Firmware/BHYVE_UEFI.fd/BHYVE_UEFI.fd \
        VMNAME

Maybe try starting bhyve with the same arguments and see if there's any difference?
 
I've got many bhyve guests for FreeBSD and don't have any issues regarding memory size allocation like in Windows.
 
Was the first attempt an imported Windows 10 installation from a VM with less memory? Maybe Windows remembered the memory size and did not recognize the additional memory after importing?
 
Back
Top