VM Memory allocation

Stretch2312

Cadet
Joined
Dec 23, 2019
Messages
5
This is my first time (ever) attempting to set up a VM. Trying to set up a VM running Windows 10, every time i attempt to allocate memory whilst setting up the VM i receive the following error "Cannot allocate xxxxMib to virtual machine: "name of VM""

Specs:
FreeNAS-11.2-U7
Intel i5-4460 CPU @ 3.20GHz ( cores)
16 GiB

Any help would would be appreciated.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
16G of RAM is a bit tight if you want to run VMs. You could try limiting the ARC size by setting the proper loader.conf variable.
 

Stretch2312

Cadet
Joined
Dec 23, 2019
Messages
5
I’m going to sound like such a noob, but I have no idea what that means. What would be the minimum specs to run this VM?
Again thank you for the help!!
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Create a "vfs.zfs.arc_max" tunable, value 12G, type loader, and reboot FreeNAS.
That leaves 4GiB for OS, VMs and plugins, so you can assign 1GiB to Win10, which is the minimum it requires.

Two caveats:
- Win10 on bhyve is not great, graphics are dog-slow. There is no fix for that, currently.
- Win10 with 1GiB is no speed demon, either.

Edited to ask: Why a Win10 VM? If all you want is a scratch Win10, and you already have a desktop, this is built into Win10. It's called the "Windows Sandbox"
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
1. Does "12G" work in loader.conf? I thought you need to put that as "12884901888"?
2. Doesn't 8G/8589934592 make more sense?

3. We use Windows 10 in bhyve in production and are quite satisfied. Two things: we use virtio. We do not use local graphics/VNC but Microsoft Remote Desktop exclusively. Use case is providing selected Windows only applications to Mac users.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
1) Yup 12G works. I have a 28G setting and it works fine
2) Maybe, yes, it certainly would help Windows

3) Interesting thank you! I’ve read a lot of “virtio crashes us and without it’s too slow” complaints here, so that’s good to know it can work! I wonder what the difference is.
 

Stretch2312

Cadet
Joined
Dec 23, 2019
Messages
5
It seems no matter how much i try to add it wont accept it. Could i have all the memory allocated elsewhere? If so, how do I check available RAM?
1586379290194.png
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
Did you create the loader.con variable and reboot?
 

Stretch2312

Cadet
Joined
Dec 23, 2019
Messages
5
Hi Patrick,
Thank you for the response, before I waste everybody's time i thought i would ask if my project is viable. I am trying to set up a VM to run a windows 10 version of ARK: Survival server for my family to connect to from Xbox and other PC's. Does my system have the specs to do that or is it a lost cause?

Thanks again for your help so far
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
I could answer that if I had a clue what ARK: survival is ;)
Sounds like a game, though. Can you play Windows games over remote desktop? My guess is no. And with 16 G of memory for your entire FreeNAS? Wouldn't the Windows VM need 16 alone to run that stuff?
So my completely uneducated guess is: no, probably not.

All I play is Clash of Clans on my iPad ...

Kind regards,
Patrick
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
How much memory are you trying to allocate there lol? It looks like a stupendous number in that screenshot.

A game server might work if it doesn’t need a GPU to run, which is often so. The heavy lifting happens client side.

Do plan on how much memory you are going to give this thing. You need 8GiB minimum for FreeNAS and ZFS, so if you want 8GiB for the game server, you’d need to restrict ARC to no more than 4 GiB, with 16 total.

Do the math and see what fits, don’t allocate more memory to the game server than it needs. And use virtio for both network and disk on that win10 vm, at least I think that’s the recommendation these days.
 

Stretch2312

Cadet
Joined
Dec 23, 2019
Messages
5
Hi Yorick,
Thanks you for the info, the problem im having is no matter how much memory (or how little) i get the same error.


Thanks
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
Did you create the "vfs.zfs.arc_max" tunable as instructed by @Yorick?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
@Stretch2312 Now that I read it again, I think I get it - you tried to enter this large number (8589934592) into the memory setting for your VM?

That's not what we told you to do ;)

In your FreeNAS web UI go to "System" --> "Tunables", click on "ADD". Then add a tunable like this:
  • Variable: vfs.zfs.arc_max
  • Value: 8589934592
  • Type: loader

Then click on "SAVE".

That being done reboot your FreeNAS and then try to create the VM again with a memory setting of e.g. 4G for your Windows.

HTH,
Patrick

P.S. The dots and the underscore in the variable name are important! Use copy&paste and enter exactly as I wrote.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
And if you want 8GiB for Windows, instead of 4GiB, make the value of that tunable "4G".
 

SKova

Dabbler
Joined
Dec 12, 2019
Messages
12
Thank you all for this great thread, I was seeing a similar thing after all of the RAM was taken by the cache and a VM would not Start without acknowledging it.
 
Top