Can't seem to add more than 2 CPUs to VM

royalba94

Cadet
Joined
Oct 2, 2018
Messages
1
Hey everyone, I'm pretty new to FreeNAS and everything so I'm sorry if there's something obvious.

I'm trying to create a windows 10 VM with 6 or 8 cores but everytime I make one in FreeNAS using the UI it only ends up with 2 cores no matter what I put in the cores field. It also does not change if I try and edit after I do the original install.

Am I missing something here?

I am running the latest version (11.2-U2.1 I believe) - tried this before and after updating with the same result :/

Thanks!

P.S. If you guys know of a good guide for updating the plex plugin that would be cool :)
 

Nvious1

Explorer
Joined
Jul 12, 2018
Messages
67
P.S. If you guys know of a good guide for updating the plex plugin that would be cool

There used to be a gui Update menu button that didn't work. Currently you need to go to the shell via the GUI or remote and type
iocage update <jailName>
and it will pull updates for the plugin. After updating, you need to either go to the plugins page and start the plugin or you can simply
iocage start <jailName>
 

Nvious1

Explorer
Joined
Jul 12, 2018
Messages
67
I'm trying to create a windows 10 VM with 6 or 8 cores

Review this link: https://www.ateamsystems.com/tech-blog/howto-windows-10-bhyve-w-freebsd-11/

It states:
Bhyve, by default, however presents each core as a physical CPU to the guest OS, thus if you try to give Windows more than 2 CPUs it will only see the first two.
Additional Windows 10 is a desktop OS so its built to support 2 physical CPUs and update 256 cores. Follow that link and it will show you what sysctl to add. You can add the sysctl in the FreeNAS GUI under the System menu as a Tunable.
 

blanchet

Guru
Joined
Apr 17, 2018
Messages
511
You have to specify the CPU core topology with FreeNAS tunables:

How to:
  • if your CPU has 8 physical cores, then
    • System | Tunable | Add
    • Variable: hw.vmm.topology.cores_per_package
    • Value: 8
    • Type: loader
    • Comment: Physical cores per socket
  • if your CPU supports also hyperthreading, then
    • System | Tunable | Add
    • Variable: hw.vmm.topology.threads_per_core
    • Value: 2
    • Type: loader
    • Comment: Threads per core
  • Reboot FreeNAS to apply
  • After rebooting, you can check that FreeNAS has added the following lines to /boot/loader.conf.local

    Code:
    hw.vmm.topology.cores_per_package="8" # Physical cores per socket
    hw.vmm.topology.threads_per_core="2" # Threads per core
  • If you allocated 4 vCPU to a bhyve VM, the guest operating systems will see 1 socket with 4 cores.
 
Last edited:

DGenerateKane

Explorer
Joined
Sep 4, 2014
Messages
95
How to:
  • if your CPU has 8 physical cores, then
    • System | Tunable | Add
    • Variable: hw.vmm.topology.cores_per_package
    • Value: 8
    • Type: sysctl
    • Comment: Physical cores per socket
  • if your CPU supports also hyperthreading, then
    • System | Tunable | Add
    • Variable: hw.vmm.topology.threads_per_core
    • Value: 2
    • Type: sysctl
    • Comment: Threads per core
  • Reboot FreeNAS to apply
  • If you allocated 4 vCPU to a bhyve VM, the guest operating systems will see 1 socket with 4 cores.
These don't work for me on 11.1-U7. I have dual 8 core processors with Hyperthreading, and after rebooting my machine the Windows 10 VM still only shows 2 cores when booted.
 

DGenerateKane

Explorer
Joined
Sep 4, 2014
Messages
95
What is the proper way to do this? I followed the directions but it didn't work. While booting I see the problem, those tunables are read only and need to be set in loader.conf. Unfortunately as I don't know this OS well enough I have no idea how to do that, and all my searches find instructions that assume you know what you are doing already.
 

DGenerateKane

Explorer
Joined
Sep 4, 2014
Messages
95
Your instructions do differ slightly than the ones posted here. I won't be able to test it for awhile though, I'm in the process of testing new drives and don't want to interrupt the badblocks tests. They take forever.
 

blanchet

Guru
Joined
Apr 17, 2018
Messages
511
You are right, there was a mistake in my first post with the tunable type. I have fixed the instructions in the post. It should work now.
 

Abear

Cadet
Joined
Jan 18, 2019
Messages
1
Thank you for this blanchet, I did not know much about how the tunables worked, but this fixed my VM issue! Thank you!
 

Kryptonit3

Dabbler
Joined
Nov 20, 2019
Messages
10
Followed this and made the tunables adjustments and rebooted and verified they were found in /boot/loader.conf.local. Created a VM with 16 cores and still shows as 2 sockets 2 virtual processors in the Windows 10 task manager performance tab.
 

mpyusko

Dabbler
Joined
Jul 5, 2019
Messages
49
You have to specify the CPU core topology with FreeNAS tunables:

How to:
  • if your CPU has 8 physical cores, then
    • System | Tunable | Add
    • Variable: hw.vmm.topology.cores_per_package
    • Value: 8
    • Type: loader
    • Comment: Physical cores per socket
  • if your CPU supports also hyperthreading, then
    • System | Tunable | Add
    • Variable: hw.vmm.topology.threads_per_core
    • Value: 2
    • Type: loader
    • Comment: Threads per core
  • Reboot FreeNAS to apply
  • After rebooting, you can check that FreeNAS has added the following lines to /boot/loader.conf.local

    Code:
    hw.vmm.topology.cores_per_package="8" # Physical cores per socket
    hw.vmm.topology.threads_per_core="2" # Threads per core
  • If you allocated 4 vCPU to a bhyve VM, the guest operating systems will see 1 socket with 4 cores.

I can confirm this works with 11.3-U2
 

Aflac_Attack

Cadet
Joined
Apr 21, 2018
Messages
8
How/where do I check this /boot/loader.conf.local?

I added the two tunables and my Win10 VM now correctly recognizes the 6 cores (Ryzen R5 1600 6core/12thread) but shouldn't it actually be seeing 12 cores/threads from the hyperthreading?
 

mpyusko

Dabbler
Joined
Jul 5, 2019
Messages
49
How/where do I check this /boot/loader.conf.local?

I added the two tunables and my Win10 VM now correctly recognizes the 6 cores (Ryzen R5 1600 6core/12thread) but shouldn't it actually be seeing 12 cores/threads from the hyperthreading?
Go into the FreeNAS/TrueNAS webgui. The go to system > tunables. If you added them properly you should see them there. I can confirm it works on FreeNAS 11.3-U5 and TrueNAS-12.0-STABLE
 

Aflac_Attack

Cadet
Joined
Apr 21, 2018
Messages
8
Ya as I said, I added them both properly and they both show up under tunables but how do I test that they're actually working, as I believe I should be seeing 12 threads instead of 6.
Blanchet states "After rebooting, you can check that FreeNAS has added the following lines to /boot/loader.conf.local". How is this done?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,737
If you assign 12 virtual CPUs to the VM you should be able to utilize 12 threads. If you assign only 6, you get only 6.

As for the checking: you log in to your NAS via ssh and type this command:
cat /boot/loader.conf.local followed by the "Enter" key.
 

Aflac_Attack

Cadet
Joined
Apr 21, 2018
Messages
8
Ah, that was my problem, I only assigned 6 cpu cores to the VM as I assumed the threads were automatically doubled when adding a core.
Win10 VM now correctly shows all 12 threads.
 
Top