- Joined
- Jul 22, 2018
- Messages
- 7,776
- Motherboard
- Supermicro X11SPA-T
- CPU
- Intel Xeon W-3275 28 Core
- Graphics
- 2xAMD RX 580 8GB
- OS X/macOS
- 13.x
- Bootloader
- OpenCore (UEFI)
- Mac
- Mac mini
- MacBook Pro
- Mobile Phone
- Android
- iOS
How to Install macOS on TrueNAS [Intel/AMD] - PCI Passthrough Guide
TrueNAS, a virtualized platform.
Although generally not recommended, you can use a single GPU for the Graphics passthrough in TrueNAS for the macOS Virtual Machine.
Download TrueNAS
Create TrueNAS Bootable USB
Enable Virtualization
The very first step is to set up BIOS to have the Virtualization enabled on your system. This is because there are a few systems that have the option to Enable/Disable the Virtualization in BIOS which affects the functionality when running a Virtual Machine. To enable Virtualization, follow the steps below.
1. On your target computer, boot to BIOS. Refer to your user manual for the BIOS Key
2. Enable Virtualization. This is usually present as Intel VT-x or Intel Virtualization Technology and AMD-V option in BIOS.
3. Save & Exit Setup.
1. Open Task Manager using CTRL+ALT+DEL Key together on your Keyboard
2. Check the Virtualization status under the Performance>CPU section.
If you notice that the Virtualization is Disabled, you need to configure the BIOS/UEFI and enable Virtualization. Enabling the Virtualization Technology feature differs from vendor to vendor and the options differ between Intel and AMD. See STEP #1 for more information.
Enable SR-IOV
Enable VT-d
CHAPTER X: Install TrueNAS
Create user
1. From the TrueNAS UI, select
2. From the Storage window click on
3. Enter a
4. Select the
General Info
Enter a
Data
The Layout consists of several VDEV layouts such as (Stripe, Mirror, RAIDZ1, RAIDZ2, RAIDZ3, dRAID1, dRAID2 and dRAID3). You can get more info on VDEV Layouts here.
Select the
NOTES:
A Pool will be added to the Storage Dashboard
If there are no VMs created on the system, a No Virtual Machines screen will be displayed.
The idea is to keep the steps simple as close as bare metal.
1. From the TrueNAS UI, select
2. From the top right corner, click on
3. Select
4. Enter a name for your Virtual Machine. You can use any. For instance, we'll be using macOS.
5. If you want to describe your Virtual Machine, you can enter a description. We'll be using macOS Sonoma for instance.
6. Select System Clock as Local for the Virtual Machine. Local is the default option. The other is UTC. Choose accordingly.
7. Select Boot Method as UEFI. As the hardware is UEFI (Haswell and later), the VM should not be legacy. UEFI is for newer Operating Systems and is highly recommended for macOS Virtual Machine.
8. Set the Shutdown Timeout to 90. 90 seconds is ideal to shut down the VM safely when you shut down the TrueNAS Host.
8. Uncheck the
9. Select 127.0.0.1 using the drop down menu from the Bind and enter a short password and click on Next. This will be our display console. Until we setup a Graphics passthrough, this will act as a virtual display where you can carry out the operations in the VM, including installing the guest OS.
10. Select 1 from the Virtual CPUs. Virtual CPUs here mean the number of sockets. If you have one physical CPU socket, use 1, and if you have dual, use 2. A lot of people get confused here and they think it's virtual CPU cores which isn't the case here.
11. Set the Number of cores per processor to no more than half of the threads available on the host computer. The virtual core allocation should be always under 50% of the actual physical CPU Cores. Allocating more than 50% of the physical core may slow down the host computer (e.g. i5-10400 is a 6 Core CPU that has 12 Threads so allocating 6 Virtual Cores is under the 50% utilization limit).
12. For Hyper-Threading to work in the guest Operating System, set the Threads as
Set the Threads as
Leave CPU Set and Pin vcpus as it is.
13. Set the
14. Set the
Leave NUMA nodeset as it is.
15.
15. Set the Disk Type as VIRTIO
16. Select the Zvol Location. In our case, it will be VM Storage as that's what we created when creating Pool.
16. Set the Size to 80GiB for the macOS Installation and click on Next. This will be our virtual disk on which we'll be installing macOS.
Skip this step if you want to use a separate physical disk for the macOS installation.
16. Select
17. The Mac Address will be automatically generated by default (randomized) so leave it as it is. You can use any other Mac Address if you want to.
18. Select the available NIC using the drop-down menu from the Attach NIC section and click on Next. Ensure Trust Guest Filters option is unchecked.
17.
Uncheck Ensure Display Device and click on Next
Review the Summary and click on Save. If you notice that the parameters are not set as recommended, you can still edit the options by clicking on the BACK button. Review the Summary and click on Save.
A Virtual Machine will be added to the Virtual Machines window
Review the Summary and click on
Now before you can start the Virtual Machine and proceed with the macOS installation, you'll need to configure a few parameters in order to boot the macOS installer.
Ensure the VM we created is not running.
Before you power on your VM, you'll need to configure some of the parameters in the Virtual Machine Configuration File to avoid issues and failures during the installation of macOS on VMware ESXi.
Please note that the following steps are mandatory and should not be skipped at all or it can prevent booting from macOS.
1. From the TrueNAS UI, select
2. Once you enter the Shell, execute the following commands:
You'll see something similar to the following as an output of the operation:
After your last command, a text editor will open.
3. Locate
4. Add the following:
5. Scroll down and find the
6. Just below the arch_type, you'll find
7. Once you finish making the changes, press the
To ensure whether the changes were made, you can check the XML file using the same command i.e service vm update 1.
8. After saving the changes, restart the TrueNAS for the changes to take effect.
1. From the TrueNAS UI, select
2. Select the target Virtual Machine and click on
3. Click on the Display button and a new tab will open prompting you to enter the password. Simply enter the password to continue.
4. The installer will load in a while and you'll see the progress with the Apple logo with a progress bar.
5. When at the Recovery screen, select your preferred language and continue
6. Select
7. When in Disk Utility, click on
8. Select VMware Virtual SATA Hard Drive Media and use the following parameters to erase the drive:
Name: Macintosh HD
Format: APFS
Scheme: GUID Partition Map
Spoiler: Installing macOS on a Dedicated Drive
NOTES:
The target disk/partition must be GUID
APFS format is recommended for High Sierra and Later
Users who plan to use High Sierra on HDD should use macOS Journaled (HFS+) Format instead of APFS Format. Users who are attempting to install macOS Sierra and prior, should use HFS+. Either way, APFS will not be available for macOS High Sierra and newer.
6. Close Disk Utility
7. Select Reinstall macOS Sonoma and continue with the options.
8. Now select Macintosh HD and click on Continue.
NOTES:
Step #6 will format the target disk. Proceed with caution.
This will take a couple of minutes and will restart at "Less than a minute is remaining". Upon completion, the system will automatically restart. Your Mac will restart to complete the installation.
Here it ends the first phase of the installation.
When the installer reboots, the installer screen will appear and continue the second phase of the installation. During this phase, the installer will install files to your target disk and create a Recovery HD partition. Upon completion, your VM will automatically restart.
After finishing the macOS installation, it's time to set up the macOS for the first usage with the newly installed macOS.
1. When you're at the welcome screen, continue with the basics options such as Keyboard setup, Network, Computer Account, and Privacy settings. Do not sign in to Apple ID when prompted.
Now the installation is complete! You should be logged in to your Desktop with the beautiful Wallpaper
Misc.
Add Custom Memory Info
The default memory is reported as 16GB and the speed is reported as 0MHz which is quite strange behavior. However, it can be fixed using OpenCore by adding the memory info manually.
Because the TrueNAS Host does have a Desktop, the macOS VM needs to be started through the Web user interface every time you want to start it. However, you can set the macOS Virtual Machine to start automatically when the TrueNAS Host is powered on.
1. From the TrueNAS Host, select
2. Select the target Virtual Machine from the Virtual Machines list and click on
3. Click on the
4. Select
Now every time you start the TrueNAS Host, the macOS VM will be automatically started. This way, after the Graphics passthrough, the experience will be almost the same as the bare metal
Remove macOS Installation Image
After installing macOS, you no longer need to use the macOS installation image
1. From the TrueNAS Host, select
2. Select the target Virtual Machine from the Virtual Machines list and click on
3. Select the
4. When prompted, select the
Remove OpenCore Recovery Image
Install OpenCore to the ESP
Unlike the bare metal, the power management matters. After all, it helps to achieve the highest available performance when at peak load and consumes less hardware resources when idle to save power.
How important the power management is on bare metal, it has the same importance on TrueNAS on a Virtual Machine. Luckily, with macOS Monterey and above, the Power Management is native and the Sleep/Wake, Restart and Shut Down functions perform normally.
However, if you're on Big Sur or prior, you'll need to inject the SSDT in order to enable the Power Management.
Just keep in mind that if you're on Big Sur or prior, you'll need to inject the SSDT in order to enable the Power Management.
When in sleep mode, the disk will read, write, and store the data. At this time, when using the TrueNAS Host (UI), you can see that the CPU is still working at a very low frequency (13MHz) which indicates the guest OS has a working sleep function. However, the monitor and peripherals are turned off during the sleep mode. It is indeed the same as real sleep on bare metal just the host machine has to be turned on all the time is the only difference.
As most of the users are interested in the GPU passthrough and due to the highest priority in the passthrough list, let's start with the GPU passthrough. As PCI passthrough is a part of the post-installation step, it is covered as a separate section due to the complexity involved.
You might wonder why USB Passthrough instead of Graphics. That's because, when you enable the GPU passthrough, you'll lose the input to the console and to perform actions (such as NVRAM reset), you'll need to have a working Keyboard/Mouse.
Although the macOS VM can be operated using a keyboard/mouse through the TrueNAS Web Interface, please note that there is actually a delay in the operation that way. For a better experience, we can assign a Keyboard/Mouse passthrough to the macOS Virtual Machine.
TrueNAS supports the addition of several USB devices. Let's understand them below:
VMDirectPath I/O - also called PCI Passthrough, allows the GPU device to be accessed directly by the guest operating system on a virtual machine. This method is the simplest way to consume a GPU and only allows the GPU card to be dedicated to one virtual machine, although a single virtual machine can make use of multiple GPUs in passthrough mode.
Unlike VMware and Proxmox VE, you don't need the GPU VBIOS (ROM) for the Graphics Passthrough. It's automatically fetched via the TureNAS itself. One of the advantages of using TrueNAS. This makes the passthrough more seamless than other platforms in the industry.
Before you can set up GPU passthrough, let's talk about the requirements first.
For a GPU passthrough, the main requirement is having a macOS Compatible GPU. Please note that the compatibility still applies, unlike bare metal. If you're using the latest macOS (Monterey and newer), you'll need a 400 or 500 series AMD GPU at least. You can definitely use a legacy GPU but you'll have to patch them using OCLP in order to drive them under macOS. If you want a great experience, you'll have to use an AMD driver-free (native) Graphics Card. A lot of options are available from the 500 series (such as RX 460/470/480 or 560/570/580/590). As always, the GPU choice depends on the workload you have.
Also, if you have an NVIDIA GPU and using macOS High Sierra or prior, you'll need to install the NVIDIA WebDrivers in order to enable the acceleration.
Please note that when you disable the console, you also lose input to the monitor connected to the TrueNAS host.
2. Scroll down and click on Configure on the Isolated GPU Device(s). When the system displays a warning, click on Close. A new dialogue box will appear to isolate the GPU Device ID
3. Select the Intel/AMD/NVIDIA GPU from the GPUs drop-down menu and click on
If you don't disable/remove the DISPLAY Device, it will act as Dual monitor when macOS boots up.
1. From the TrueNAS Host, select
2. Select the target Virtual Machine from the Virtual Machines list and click on
3. Select the
4. When prompted, select the
You should see the DISPLAY Device removed from the Devices list.
5. Connect the monitor using DP or HDMI
6. Restart the TrueNAS Host to make the required changes.
7. Power On macOS VM.
8. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
9. Boot to/into macOS.
Once the VBIOS is loaded successfully from the GPU, the DCUI will disappear and you should see the Apple logo with a progress bar or the verbose on your monitor.
When you turn off the macOS VM, the monitor will have the TrueNAS console displayed on the monitor and when you start the macOS VM, it will automatically switch to macOS VM.
Native GPU Passthrough
Legacy GPU Passthrough
GPU Spoof
Here we have used WX4100 as an example which is an unsupported GPU under macOS and requires a Fake Device ID (spoof) to work/to achieve the Graphics acceleration
APU Passthrough
APU passthrough is slightly different from IGPU and dGPU passthrough. Unlike bare metal, the requirements are same. All you need is NootedRed.kext to drive the APU. See AMD GPU Graphics for more information.
No with the efforts of Noot, a new kext has been developed
If you do not see the GPU in the PCI Device list, make sure you have enabled Virtualization and VT-d in BIOS/UEFI.
Although you can passthrough the PCI Devices, the compatibility and the limitations still apply to macOS.
USB Passthrough
On some of the Ryzen based systems, its a bug that when you select the PCI Devices for passthrough, it starts to jump as soon as you select the PCI Devices. To fix, use the filter search box and type the PCI Device name and then select it respectively. This is typically because of the PCI Devices connected to the same bridge/device node.
The speed of the Virtual Disk is close to the Gen3 pass-through and a bare metal install:
1. From the TrueNAS Host, select
2. Select the target Virtual Machine from the Virtual Machines list and click on
3. Click on
4. Select
5. Select the target
6. If you want, you can assign a Device Order but it is not mandatory.
7. Click on
You should see a new PCI Device listed under the Devices list.
8. Restart the TrueNAS Host to make the required changes.
9. Power On macOS VM.
10. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
11. Boot to/into macOS.
You should see the SATA Controller under macOS and the connected devices should be available now.
Results:
1. From the TrueNAS Host, select
2. Select the target Virtual Machine from the Virtual Machines list and click on
3. Click on
4. Select
5. Select the target
6. If you want, you can assign a Device Order but it is not mandatory.
7. Click on
You should see a new PCI Device listed under the Devices list.
8. Restart the TrueNAS Host to make the required changes.
9. Power On macOS VM.
10. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
11. Boot to/into macOS.
You should see the NVMe under macOS now
NOTE:
Do not share the dataset drive (either on the SATA/SAS/NVMe) on the macOS VM. This will cause intermittent freezes and the Virtual Disk on which macOS is installed, couldn't be found either. This is really dangerous.
Although the disk media is reported as rotational, it is not. The speed is 1462 and 802 MB/s respectively. Whereas, with the VirtIO, the speed is quite fast, similar to a bare metal
If you want to add any disk passthrough to the macOS VM, you can do that without the need for an extra physical disk. The same dataset disk can be used to create a disk passthrough of the desired capacity.
STEP 1: Create a Zvol
1. From the TrueNAS UI, select Datasets from the left pane.
2. From the Datasets window click on Add Zvol. A new dialogue box will appear to add the Zvol.
When at the Add Zvol dialogue box, use the following parameters to create a Zvol:
Zvol name:
Comments:
Size for this zvol:
3. Enter a name for your Zvol name. You can use any. For instance, we'll be using Virtual Disk
4. If you want to add any comment, to describe the Zvol, you can enter it here. We'll be skipping for now
5. Set the required size for the zvol you wish/want to allocate.
6. Depending on the resources and performance, choose one of the disk provisions as described below. We'll choose Thick Provisioning as that's the default option and is highly recommended. You don't need to configure this option unless you want to use Thin Provisioning which is not recommended.
Thick Provisioning
By default, the disk provisioning is set to Thick provisioned. This will allocate all the disk space once you create the Zvol. Although Thick provisioned can take a much longer time to create the virtual disk as compared to Thin Provisioning, it can enhance the performance of the virtual disk as it zeros out all blocks immediately during provisioning and also requires all of the physical disk space to be available right now. This process can be a lot slower and time-consuming if you're low on the hardware resources. If you do not want to allocate all the space now, select Sparse, and the virtual disk starts small and grows as you add data to it. Choose as you would like. We highly suggest using Thick Provisioned, if you do not plan to use a dedicated separate disk for installing macOS.
Thin Provisioning
Thin Provisioning, also known as
7. Leave the rest options as it is and click on
You should see a new Zvol listed under the Dataset node.
STEP 2: Add Virtual Disk to macOS VM
1. From the TrueNAS Host, select
2. Select the target Virtual Machine from the Virtual Machines list and click on
3. Click on
4. Select
5. Select the target Zvol you want to add in the Search box in the
6. Select
6. If you want, you can assign a Device Order but is not mandatory.
7. Click on
You should see a new PCI Device listed under the Devices list.
Once you finish adding the disk, restart the TrueNAS Host to make the required changes. Until you restart the TrueNAS Host, you'll not be able to attach the disk to the macOS VM.
9. Power On macOS VM.
10. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
11. Boot to/into macOS.
When we enter the system, the macOS will prompt you to initialize the disk. However, to use the disk under macOS, you'll need to initialize the disk by formatting the virtual disk in a required format which macOS supports.
12. When you get the disk initialization prompt, click on Initialize
13. Select the newly added disk in the Disk Utility and use the following parameters to erase the disk. The new virtual disk will appear as
14. Click on Done. A new disk should appear on your Desktop now.
15. Quit Disk Utility
NOTE:
1. Boot to macOS
2. Backup your data as necessary.
3. Shut down macOS.
4. From the TrueNAS UI, select
5. From the Datasets window select the target Zvol and click on Delete. A new dialogue box will appear to delete the Zvol.
6. When prompted, enter the path for the Zvol. Select the
7. From the TrueNAS Host, select
8. Select the target Virtual Machine from the Virtual Machines list and click on
9. Select the DISK and click on ... and then select Delete. A new dialogue box will appear to delete the Disk.
10. When prompted, select Delete zvol device and enter the Disk name. Select the
You should no longer see the target DISK listed under the Devices list.
NOTE:
Results:
Please keep in mind that do not change the NVMe positions, either for the VMware ESXi on which is installed or for the passthrough device. If you do so, the VM will become invalid and the ESXi Server will take a much longer time to boot.
In addition, when doing a storage passthrough, the compatibility for macOS remains the same (i.e. unsupported drives will result in KP)
U.2 Passthrough
The U.2 can be passthroughed like NVMe. If you're using a dedicated HBA/RAID Card, you'll need to install compatible drivers under macOS to enable the support.
Unlike other virtualization platforms (such as), where you'll need at least two USB Controllers for proper use in the VM, you can either individually passthrough either each USB device to the macOS VM or the whole USB Controller (XHCI/EHCI/UHCI) to the macOS VM in TrueNAS. It's quite flexible and you don't have to install a USB PCIe Card just to use USB peripherals (including BT) on a macOS VM.
In order to utilize all the functions of a WiFi Card, WiFi alone is not enough. Bluetooth also needs to function. As Bluetooth is on USB protocol, you must passthrough the USB Controller/Devices so that we can add our Bluetooth Device to macOS. Moreover, using the Keyboard and Mouse, you can have full control of your macOS VM just like a bare metal install.
1. From the TrueNAS Host, select
2. Select the target Virtual Machine from the Virtual Machines list and click on
3. Click on
4. Select
5. Select
6. Select the required USB Device (typically Keyboard, Mouse, and Bluetooth) using the drop-down menu from the
7. If you want, you can assign a Device Order but not mandatory.
8. Click on
You should see a new USB Device listed under the Devices list.
9. Restart the TrueNAS Host to make the required changes.
10. Power On macOS VM.
11. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
Once you start the macOS VM, the Keyboard, and Mouse will start working within the OC menu. When we enter the system, we also find that our all shared USB Devices can be recognized normally. After the USB passthrough, we can use the Keyboard and Mouse to operate the macOS Virtual Machine.
NOTE:
Results:
1. From the TrueNAS Host, select
2. Select the target Virtual Machine from the Virtual Machines list and click on
3. Click on
4. Select
5. Select the target USB Controller (XHCI/EHCI/UHCI) in the Search box in the
6. If you want, you can assign a Device Order but is not mandatory.
7. Click on
You should see a new PCI Device listed under the Devices list.
8. Restart the TrueNAS Host to make the required changes.
9. Power On macOS VM.
10. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
11. Boot to/into macOS.
After the USB passthrough, we can use the Keyboard and Mouse to operate the macOS Virtual Machine. When we enter the system, we also find that our all USB Devices can be recognized normally.
Results:
1. From the TrueNAS Host, select
2. Select the target Virtual Machine from the Virtual Machines list and click on
3. Click on
4. Select
5. Select the target NIC in the Search box in the
6. If you want, you can assign a Device Order but not mandatory.
7. Click on
You should see a new PCI Device listed under the Devices list.
8. Restart the TrueNAS Host to make the required changes.
9. Power On macOS VM.
10. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
11. Boot to/into macOS.
NOTES:
NOTE:
2. Open the config.plist using OCAT
3. Add the following patch under the Kernel>Patch section of your config.plist. In addition, you'll need to specify the MinKernel to 23.0.0 to ensure that the kext is only loaded on macOS Monterey and above.
4. Save config.plist
5. Restart macOS
See Network driving cards for more info.
The implementation is the same as AMD Systems as it lacks VT-d which is now a must requirement in order to drive several hardware under newer macOS versions (typically Monterey and later).
Results:
1. From the TrueNAS Host, select
2. Select the target Virtual Machine from the Virtual Machines list and click on
3. Click on
4. Select
5. Select the target WiFi in the Search box in the
6. If you want, you can assign a Device Order but not mandatory.
7. Click on
You should see a new PCI Device listed under the Devices list.
8. Restart the TrueNAS Host to make the required changes.
9. Power On macOS VM.
10. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
11. Boot to/into macOS.
12. You should see the WiFi under macOS now
The native functions such as App Store, AirDrop, Handoff, and iServices are available and work as expected.
As the Bluetooth function is handled by a USB bus, see USB Passthrough for more info.
As Bluetooth is based on USB protocol, we already passthrough it above. As a result, the WiFi/BT works as expected
Results:
BCM94360NG
BCM94352Z
NOTES:
Finally, it's the Thunderbolt time. Yes, don't be surprised so much. The VM also supports Thunderbolt Passthrough including onboard and AIC.
NOTE:
It should be noted that whatever device(s) require the
Results:
The macOS updates can be installed and processed normally, worry-free, just like a bare metal machine with OpenCore Bootloader using the Software Update mechanism from the System Preferences. As always, you must update the OpenCore and the related kexts before applying any updates to the system. See updating macOS for more information.
A very fast, stable internet connection is required due to the offline installer. Being an online installer, the installer fetches the InstallAssistant.pkg for the desired macOS version. If there are frequent dropouts, the download will fail and the installation will be terminated with the reason
TrueNAS, a virtualized platform.
Requirements
Following are the requirements for installing macOS on TrueNAS. Please ensure you meet the requirements before proceeding with this guide.CPU | Intel/AMD CPU. 4 Core minimum. 6 Core or more is recommended. Haswell and later is recommended. macOS Compatible CPU. See CPU Compatibility for more information. |
Memory | 16GB or more |
Storage | A dedicated SSD with at least 128GB capacity for the Pool. Two, if going for a mirror. Additional capacity needed for storage sharing A separate Drive if going to passthrough |
Graphics | macOS compatible GPU for Graphics passthrough. See GPU Compatibility for more information. |
Peripherals | A separate Keyboard/Mouse to use in VM. |
Operating System | Windows 10 or later is recommended. |
Tools | TrueNAS Scale Rufus OpenCorePkg |
Although generally not recommended, you can use a single GPU for the Graphics passthrough in TrueNAS for the macOS Virtual Machine.
Download TrueNAS
Create TrueNAS Bootable USB
Enable Virtualization
The very first step is to set up BIOS to have the Virtualization enabled on your system. This is because there are a few systems that have the option to Enable/Disable the Virtualization in BIOS which affects the functionality when running a Virtual Machine. To enable Virtualization, follow the steps below.
1. On your target computer, boot to BIOS. Refer to your user manual for the BIOS Key
2. Enable Virtualization. This is usually present as Intel VT-x or Intel Virtualization Technology and AMD-V option in BIOS.
3. Save & Exit Setup.
STEP 2: Verify the Virtualization
The next step is to verify whether the virtualization is enabled or not. This step is required in order to ensure you're on the right track and you meet the hardware requirements to run a Virtual Machine. To verify the WiFi/BT detection, follow the steps below.1. Open Task Manager using CTRL+ALT+DEL Key together on your Keyboard
2. Check the Virtualization status under the Performance>CPU section.
If you notice that the Virtualization is Disabled, you need to configure the BIOS/UEFI and enable Virtualization. Enabling the Virtualization Technology feature differs from vendor to vendor and the options differ between Intel and AMD. See STEP #1 for more information.
Enable SR-IOV
Enable VT-d
CHAPTER X: Install TrueNAS
CHAPTER X: Configure TrueNAS
Now that we have installed TrueNAS, it's time to configure the TrueNAS after which we'll proceed with creating a Virtual Machine and install macOS on it.Create user
Create Pool
Before you can create a Virtual Machine, you'll need to create a pool where the Virtual Machine disk(s) and ISOs will be stored. By default, TrueNAS will display No Pools message if no Pools has been created before.1. From the TrueNAS UI, select
Storage
from the left pane.2. From the Storage window click on
Create Pool
. A Pool Creation Wizard will appear to create a Pool.3. Enter a
name
for your Pool and click on Next
. You can use any. For instance, we'll be using VM Pool
.4. Select the
Layout
according to your disk configuration and click on Next
. The available disk will be automatically selected.General Info
Enter a
name
for your Pool and click on Next
. You can use any, up to 50 characters in length. For instance, we'll be using Virtual Machine. Please ensure that the Encryption option is not checked.Data
The Layout consists of several VDEV layouts such as (Stripe, Mirror, RAIDZ1, RAIDZ2, RAIDZ3, dRAID1, dRAID2 and dRAID3). You can get more info on VDEV Layouts here.
Select the
Layout
according to your disk configuration and click on Next
. The available disk will be automatically selected.NOTES:
- As this pool is being created for the macOS VM, you should consider using at least a mirror. However, to use a mirror, you'll need two identical disks as a requirement. If you're just trying it out, you can continue with Stripe.
- Although a SLOG Device is recommended to improve the write speeds for VMs and databases, it's completely optional. You can add it if you have a dedicated one otherwise you can skip it as it is completely optional.
Review
. Review the Summary and click on Create Pool
. When prompted, select the Confirm checkbox and click on Continue. If you notice that the parameters are not set as recommended, you can still edit the options by clicking on the Back
button. Review the Summary again and click on Finish.A Pool will be added to the Storage Dashboard
CHAPTER X: Create a Virtual Machine
If there are no VMs created on the system, a No Virtual Machines screen will be displayed.
The idea is to keep the steps simple as close as bare metal.
1. From the TrueNAS UI, select
Virtual Machines
from the left pane.2. From the top right corner, click on
Add
to launch the Virtual Machine creation wizard. A new dialogue box will appear to add the Virtual Machine.Operating System
The Operating System settings specify the VM Operating System type, boot method, and display type.3. Select
Linux
as a Guest Operating System using the drop-down menu from the Guest Operating System list4. Enter a name for your Virtual Machine. You can use any. For instance, we'll be using macOS.
5. If you want to describe your Virtual Machine, you can enter a description. We'll be using macOS Sonoma for instance.
6. Select System Clock as Local for the Virtual Machine. Local is the default option. The other is UTC. Choose accordingly.
7. Select Boot Method as UEFI. As the hardware is UEFI (Haswell and later), the VM should not be legacy. UEFI is for newer Operating Systems and is highly recommended for macOS Virtual Machine.
8. Set the Shutdown Timeout to 90. 90 seconds is ideal to shut down the VM safely when you shut down the TrueNAS Host.
8. Uncheck the
Start on Boot option
. If you want to start the macOS VM as soon as the TrueNAS boots up, leave this option checked.9. Select 127.0.0.1 using the drop down menu from the Bind and enter a short password and click on Next. This will be our display console. Until we setup a Graphics passthrough, this will act as a virtual display where you can carry out the operations in the VM, including installing the guest OS.
CPU And Memory
The CPU And Memory settings specify the number of Virtual CPUs, Socket, and Threads to the Virtual Machine. Also, the CPU mode, model, and the memory size.10. Select 1 from the Virtual CPUs. Virtual CPUs here mean the number of sockets. If you have one physical CPU socket, use 1, and if you have dual, use 2. A lot of people get confused here and they think it's virtual CPU cores which isn't the case here.
11. Set the Number of cores per processor to no more than half of the threads available on the host computer. The virtual core allocation should be always under 50% of the actual physical CPU Cores. Allocating more than 50% of the physical core may slow down the host computer (e.g. i5-10400 is a 6 Core CPU that has 12 Threads so allocating 6 Virtual Cores is under the 50% utilization limit).
12. For Hyper-Threading to work in the guest Operating System, set the Threads as
2
.Set the Threads as
2
for the Hyper-Threading to work in the guest Operating System. For CPUs that support Hyper-Threading Technology, the threads are usually twice the cores.Leave CPU Set and Pin vcpus as it is.
13. Set the
CPU Mode
as Host Model
. This will make the installation seamless like a bare metal install or else you will need to add a lot of parameters to the Virtual Machine Configuration which can be tedious. Even if you're using a CPU which is not supported natively on macOS, you can spoof the Spoof ID easily using OpenCore.14. Set the
Memory Size
and Minimum Memory Size
as 4096MiB
and click on Next
. If you have enough memory on the host system, 8192MiB would be preferred. The least would be 4096MiB or 4GiB. For the best performance, 16GiGB or more is recommended. ZFS loves RAM Leave NUMA nodeset as it is.
Disks
The Disk settings specify the Virtual Disk type, location, and size for the target VM. You can either create a new zvol on an existing dataset or use an existing zvol or file for the VM.15.
15. Set the Disk Type as VIRTIO
16. Select the Zvol Location. In our case, it will be VM Storage as that's what we created when creating Pool.
16. Set the Size to 80GiB for the macOS Installation and click on Next. This will be our virtual disk on which we'll be installing macOS.
Skip this step if you want to use a separate physical disk for the macOS installation.
Network Interface
The Network settings specify the Network Adapter type, MAC Address and the physical network interface for the VM.16. Select
VirtIO
from the Adapter Type17. The Mac Address will be automatically generated by default (randomized) so leave it as it is. You can use any other Mac Address if you want to.
18. Select the available NIC using the drop-down menu from the Attach NIC section and click on Next. Ensure Trust Guest Filters option is unchecked.
Installation Media
The installation Media settings specify the Operating System Installation image on a dataset or you can upload one from the local machine.17.
Uncheck Ensure Display Device and click on Next
Review the Summary and click on Save. If you notice that the parameters are not set as recommended, you can still edit the options by clicking on the BACK button. Review the Summary and click on Save.
A Virtual Machine will be added to the Virtual Machines window
GPU
1. Make sure both the options Hide from MSR and Ensure Display Device are unchecked.Review the Summary and click on
Save
to finish creating a Virtual Machine. If you notice that the parameters are not set as recommended, you can still edit the options by clicking on the Back
button. Review the Summary again and click on Save
.CHAPTER X: Configure Virtual Machine Parameters
Now before you can start the Virtual Machine and proceed with the macOS installation, you'll need to configure a few parameters in order to boot the macOS installer.
Ensure the VM we created is not running.
Before you power on your VM, you'll need to configure some of the parameters in the Virtual Machine Configuration File to avoid issues and failures during the installation of macOS on VMware ESXi.
Please note that the following steps are mandatory and should not be skipped at all or it can prevent booting from macOS.
1. From the TrueNAS UI, select
System Settings
from the left pane and then select Shell
.2. Once you enter the Shell, execute the following commands:
XML:
#Enter CLI Mode
sudo cli
//When prompted, enter the administrator password to continue
#Query VM Service to find the ID
service vm query
// Find the ID of your VM here. In this example, our macOS VM has an ID of 1.
#Update the VM Configuration
service vm update 1
You'll see something similar to the following as an output of the operation:
After your last command, a text editor will open.
3. Locate
vm_update:
line and uncomment the #
followed by the command_line_args:
line. This is very important or your changes will not be saved and the XML file will throw an error when saving. Please note that the letters are case-sensitive.4. Add the following:
Code:
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
-smbios type=2 -device '{"driver":"usb-kbd","id":"input1","bus":"usb.0","port":"2"}'
-global nec-usb-xhci.msi=off -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off
5. Scroll down and find the
arch_type
line. Uncomment #
followed by the arch_type
and add the following to it
Code:
x86_64
6. Just below the arch_type, you'll find
machine_type
. Uncomment #
followed by the machine_type
and add the following to it
Code:
q35
7. Once you finish making the changes, press the
ESC
key. When prompted, select Yes
and the changes will be saved permanently.To ensure whether the changes were made, you can check the XML file using the same command i.e service vm update 1.
8. After saving the changes, restart the TrueNAS for the changes to take effect.
CHAPTER X: Installing macOS
Once everything is set, you're ready to clean install the desired macOS version on your TrueNAS host. Please note that the host computer must be connected to the internet in order to install macOS since the BaseSystem is merely a recovery image and a full macOS installer will be downloaded during the installation. The Operating System is approximately 12GB in size. So if you're using any sort of Mobile Data make sure you have enough/sufficient plan if using a Mobile Data plan.Installing macOS on a shared Drive
1. From the TrueNAS UI, select
Virtual Machines
from the left pane2. Select the target Virtual Machine and click on
Start
to power on the VM.3. Click on the Display button and a new tab will open prompting you to enter the password. Simply enter the password to continue.
4. The installer will load in a while and you'll see the progress with the Apple logo with a progress bar.
5. When at the Recovery screen, select your preferred language and continue
6. Select
Disk Utility
and click on Continue
.7. When in Disk Utility, click on
View
, and select Show all Devices
.8. Select VMware Virtual SATA Hard Drive Media and use the following parameters to erase the drive:
Name: Macintosh HD
Format: APFS
Scheme: GUID Partition Map
Spoiler: Installing macOS on a Dedicated Drive
NOTES:
The target disk/partition must be GUID
APFS format is recommended for High Sierra and Later
Users who plan to use High Sierra on HDD should use macOS Journaled (HFS+) Format instead of APFS Format. Users who are attempting to install macOS Sierra and prior, should use HFS+. Either way, APFS will not be available for macOS High Sierra and newer.
6. Close Disk Utility
7. Select Reinstall macOS Sonoma and continue with the options.
8. Now select Macintosh HD and click on Continue.
NOTES:
Step #6 will format the target disk. Proceed with caution.
This will take a couple of minutes and will restart at "Less than a minute is remaining". Upon completion, the system will automatically restart. Your Mac will restart to complete the installation.
Here it ends the first phase of the installation.
When the installer reboots, the installer screen will appear and continue the second phase of the installation. During this phase, the installer will install files to your target disk and create a Recovery HD partition. Upon completion, your VM will automatically restart.
STEP 3: Finishing macOS Setup
After several minutes of waiting and keeping yourself patient, you should see the macOS setup screenAfter finishing the macOS installation, it's time to set up the macOS for the first usage with the newly installed macOS.
1. When you're at the welcome screen, continue with the basics options such as Keyboard setup, Network, Computer Account, and Privacy settings. Do not sign in to Apple ID when prompted.
Now the installation is complete! You should be logged in to your Desktop with the beautiful Wallpaper
CHAPTER 7: Post-installation
Although, a bare metal installation might have several things working if you have followed the guide precisely, however, this is not the case with TrueNAS VM. A macOS VM involves a lot more post-install steps such as PCI passthrough by which you can gain the advantage of Graphics acceleration and such. Only a few basic things will work (such as network) and a lot of function and hardware support will lack until you fix them using the post-installation steps covered in this guide, starting with the power management.Misc.
Add Custom Memory Info
The default memory is reported as 16GB and the speed is reported as 0MHz which is quite strange behavior. However, it can be fixed using OpenCore by adding the memory info manually.
Auto start when power on
Because the TrueNAS Host does have a Desktop, the macOS VM needs to be started through the Web user interface every time you want to start it. However, you can set the macOS Virtual Machine to start automatically when the TrueNAS Host is powered on.
1. From the TrueNAS Host, select
Virtualization
.2. Select the target Virtual Machine from the Virtual Machines list and click on
Devices
.3. Click on the
Edit
button. A new dialogue box will appear to edit the macOS VM.4. Select
Start on Boot
checkbox and click on Save
.Now every time you start the TrueNAS Host, the macOS VM will be automatically started. This way, after the Graphics passthrough, the experience will be almost the same as the bare metal
Remove macOS Installation Image
After installing macOS, you no longer need to use the macOS installation image
1. From the TrueNAS Host, select
Virtualization
.2. Select the target Virtual Machine from the Virtual Machines list and click on
Devices
.3. Select the
DISPLAY
Device and click on ... and then select Delete. A new dialogue box will appear to delete the Display Device.4. When prompted, select the
Force Delete
checkbox and click on Delete Device
.Remove OpenCore Recovery Image
Install OpenCore to the ESP
I. Power Management
Unlike the bare metal, the power management matters. After all, it helps to achieve the highest available performance when at peak load and consumes less hardware resources when idle to save power.
How important the power management is on bare metal, it has the same importance on TrueNAS on a Virtual Machine. Luckily, with macOS Monterey and above, the Power Management is native and the Sleep/Wake, Restart and Shut Down functions perform normally.
However, if you're on Big Sur or prior, you'll need to inject the SSDT in order to enable the Power Management.
Just keep in mind that if you're on Big Sur or prior, you'll need to inject the SSDT in order to enable the Power Management.
Sleep/Wake
The sleep/wake function slightly differs on VM as compared to Bare Metal. When you run the guest OS on a Virtual Machine the host system has to be turned on all the time. However, it is quite surprising that TrueNAS actually supports Sleep/Wake and works as expected. When in Sleep mode, you can wake up the macOS using the Mouse and/or Keyboard.When in sleep mode, the disk will read, write, and store the data. At this time, when using the TrueNAS Host (UI), you can see that the CPU is still working at a very low frequency (13MHz) which indicates the guest OS has a working sleep function. However, the monitor and peripherals are turned off during the sleep mode. It is indeed the same as real sleep on bare metal just the host machine has to be turned on all the time is the only difference.
Restart
The restart function works normally as of bare metal. You can restart using Apple Logo>Restart or using the Restart button from TrueNAS Host (UI). However, it is always recommended to restart from the macOS to avoid data loss.Shut Down
Like the restart function, the Shut Down also works normally as of bare metal. You can either shut down using the Apple Logo>Shut down or via the Power off button from the TrueNAS Host (UI). However, it is always recommended to perform Shut Down within macOS to avoid data loss.CHAPTER X: PCI Passthrough
As most of the users are interested in the GPU passthrough and due to the highest priority in the passthrough list, let's start with the GPU passthrough. As PCI passthrough is a part of the post-installation step, it is covered as a separate section due to the complexity involved.
You might wonder why USB Passthrough instead of Graphics. That's because, when you enable the GPU passthrough, you'll lose the input to the console and to perform actions (such as NVRAM reset), you'll need to have a working Keyboard/Mouse.
Although the macOS VM can be operated using a keyboard/mouse through the TrueNAS Web Interface, please note that there is actually a delay in the operation that way. For a better experience, we can assign a Keyboard/Mouse passthrough to the macOS Virtual Machine.
TrueNAS supports the addition of several USB devices. Let's understand them below:
I. GPU Passthrough
PCI passthrough for GPU cards in TrueNAS allows a Virtual Machine (VM) to access a physical GPU card directly, bypassing the hypervisor layer. This enables a virtual machine to fully utilize the capabilities of a GPU, making it suitable for compute-intensive tasks like machine learning, high-performance computing, and computer vision. This section will walk users through setting up PCI passthrough for GPU under macOS VM in TrueNAS.VMDirectPath I/O - also called PCI Passthrough, allows the GPU device to be accessed directly by the guest operating system on a virtual machine. This method is the simplest way to consume a GPU and only allows the GPU card to be dedicated to one virtual machine, although a single virtual machine can make use of multiple GPUs in passthrough mode.
Unlike VMware and Proxmox VE, you don't need the GPU VBIOS (ROM) for the Graphics Passthrough. It's automatically fetched via the TureNAS itself. One of the advantages of using TrueNAS. This makes the passthrough more seamless than other platforms in the industry.
Before you can set up GPU passthrough, let's talk about the requirements first.
For a GPU passthrough, the main requirement is having a macOS Compatible GPU. Please note that the compatibility still applies, unlike bare metal. If you're using the latest macOS (Monterey and newer), you'll need a 400 or 500 series AMD GPU at least. You can definitely use a legacy GPU but you'll have to patch them using OCLP in order to drive them under macOS. If you want a great experience, you'll have to use an AMD driver-free (native) Graphics Card. A lot of options are available from the 500 series (such as RX 460/470/480 or 560/570/580/590). As always, the GPU choice depends on the workload you have.
Also, if you have an NVIDIA GPU and using macOS High Sierra or prior, you'll need to install the NVIDIA WebDrivers in order to enable the acceleration.
Please note that when you disable the console, you also lose input to the monitor connected to the TrueNAS host.
Isolate GPU
1. From the TrueNAS UI, selectSystem Settings
from the left pane and then choose Advanced
.2. Scroll down and click on Configure on the Isolated GPU Device(s). When the system displays a warning, click on Close. A new dialogue box will appear to isolate the GPU Device ID
3. Select the Intel/AMD/NVIDIA GPU from the GPUs drop-down menu and click on
Save
. TrueNAS will take some time to isolate the GPU Device ID.Disable VGA Driver
If the VGA driver is claimed by the TrueNAS Host, you'll not get the complete display on the monitor connected to the target GPU for display. You'll only have the display when macOS boots up. The OC picker and the verbose will not be displayed on the monitor at all. Moreover, you'll need to use a VNC or a similar remote application to login and operate the Mac. The Display console will be also stuck at verbose. However, the system will have a graphics acceleration. In order to get the proper display on your monitor, you'll have to turn off/remove the built-in virtual display.If you don't disable/remove the DISPLAY Device, it will act as Dual monitor when macOS boots up.
1. From the TrueNAS Host, select
Virtualization
.2. Select the target Virtual Machine from the Virtual Machines list and click on
Devices
.3. Select the
DISPLAY
Device and click on ... and then select Delete. A new dialogue box will appear to delete the Display Device.4. When prompted, select the
Force Delete
checkbox and click on Delete Device
.You should see the DISPLAY Device removed from the Devices list.
5. Connect the monitor using DP or HDMI
6. Restart the TrueNAS Host to make the required changes.
7. Power On macOS VM.
8. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
9. Boot to/into macOS.
Once the VBIOS is loaded successfully from the GPU, the DCUI will disappear and you should see the Apple logo with a progress bar or the verbose on your monitor.
When you turn off the macOS VM, the monitor will have the TrueNAS console displayed on the monitor and when you start the macOS VM, it will automatically switch to macOS VM.
I. AMD
Native GPU Passthrough
Legacy GPU Passthrough
GPU Spoof
Here we have used WX4100 as an example which is an unsupported GPU under macOS and requires a Fake Device ID (spoof) to work/to achieve the Graphics acceleration
APU Passthrough
APU passthrough is slightly different from IGPU and dGPU passthrough. Unlike bare metal, the requirements are same. All you need is NootedRed.kext to drive the APU. See AMD GPU Graphics for more information.
No with the efforts of Noot, a new kext has been developed
II. Intel
For Intel, only IGPUs are supported at the moment. No ARC GPUs of course as none of them are supportedIGPU Passthrough
You can use IGPU passthrough under macOS. However, you'll not be able to use a monitor and can only use Console/VNC to get the display.III. NVIDIA
Following GPU passthrough types are supported on macOS VMs using TrueNAS. Depending on theNative GPU Passthrough
Native NVIDIA GPUs that do not require a WebDriver, i.e. Kepler based Cards (such as GT710) not only work OOTB (a reason why we recommend using native cards) but have proper Graphics acceleration with full QE/CI. In addition, the display on the monitor can be driven as well. The display is quite crisp as of bare metal and the performance is so high that it doesn't feel you're on VNC/Remote but on a bare metal machine. It's just so fluid and the experience is amazing. The performance is simply unmatched.Unsupported GPU Passthrough
Although once supported at the time of High Sierra, the Pascal series GPUs did not have any support further. However, with the introduction of OCLP, it is now possible to use unsupported cards that require WebDriver, i.e. Pascal Cards (such as GTX 1070Ti) works fine after patching the system with OCLP. The GPU works with proper Graphics acceleration with full QE/CI. In addition, the display on the monitor can be driven as well. However, due to the driver limitations itself, only OpenGL is supported at the moment. Unlike the native GPU passthrough, the display is quite crisp as of bare metal and the performance is so high that it doesn't feel like you're using it on a VM but on a bare metal machine. It's just so fluid and the experience is amazing. The performance is simply unmatched.Legacy GPU Passthrough
Although it is highly recommended to use a native, macOS compatible GPU for passthrough, there can be cases where you would want to use a legacy GPU for passthrough. For such cases, you can use OCLP to patch the system volume to enable the Legacy GPU passthrough on the latest macOS version.GPU Spoof
Unlike bare metal, GPU spoofing is also supported on macOS VMs using TrueNAS. The steps are the same as bare metal. As TrueNAS does not support spoofing Device ID, you'll have to use OpenCore for Device ID spoof. You can either use DeviceProperties or SSDT to spoof the Device ID for your GPU. See GPU Spoof for more information.
If you do not see the GPU in the PCI Device list, make sure you have enabled Virtualization and VT-d in BIOS/UEFI.
Unsupported GPU Passthrough
Although the GPU passthrough does not require OpenCore when you have a macOS compatible GPU with native support under macOS, you may need to use OpenCore if you plan to use an unsupported GPU such as APU,Although you can passthrough the PCI Devices, the compatibility and the limitations still apply to macOS.
USB Passthrough
On some of the Ryzen based systems, its a bug that when you select the PCI Devices for passthrough, it starts to jump as soon as you select the PCI Devices. To fix, use the filter search box and type the PCI Device name and then select it respectively. This is typically because of the PCI Devices connected to the same bridge/device node.
II. Storage Passthrough
Unfortunately, unlike the VMware Workstation, there is no option to choose the Virtual Disk type (such as IDE/SATA or NVMe) in ESXi at the time of creating a Virtual Machine. The Virtual Disk created on the ESXi host is recognized as SATA type under macOS. When using Thick provisioning, delayed zeroed, the speed test for an SK Hynix PC801 (OEM) which has similar specs as the consumer drive (P41 Platinum) offering 3500 MB/s Read and 3000 MB/s Write speeds respectively on a PCIe Gen3 (x4) onboard NVMe Slot. As per the datasheet, the drive offers up to 7000 MB/s Read and 4700 MB/s Write for a 512GB variant on a Gen4 (x4) NVMe slot.The speed of the Virtual Disk is close to the Gen3 pass-through and a bare metal install:
SATA Passthrough
Although it's very clear that TrueNAS is for storage purposes and the onboard SATA/SAS ports will be used for the disks for pools, you can still passthrough the onboard SATA/SAS ports on the PCH bus. However, this isn't considered a very safe practice and is only recommended for all-flash storage setups, unless you have multiple SATA/SAS ports or HBA Card to connect your pool disks. This is because you might need to add the disks to the onboard SATA/SAS ports on the PCH bus for Storage Pool(s) in TrueNAS. Also, please note that once you start the macOS VM, you'll lose all access to the SATA/SAS Devices in TrueNAS and all such Devices will be only available under the macOS VM.1. From the TrueNAS Host, select
Virtualization
.2. Select the target Virtual Machine from the Virtual Machines list and click on
Devices
.3. Click on
Add
. A new dialogue box should appear to add the PCI Devices.4. Select
PCI Passthrough Device
from the drop-down menu in the Type
list.5. Select the target
SATA Controller
in the Search box from the PCI Passthrough Device
list.6. If you want, you can assign a Device Order but it is not mandatory.
7. Click on
Save
.You should see a new PCI Device listed under the Devices list.
8. Restart the TrueNAS Host to make the required changes.
9. Power On macOS VM.
10. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
11. Boot to/into macOS.
You should see the SATA Controller under macOS and the connected devices should be available now.
Results:
NVMe Passthrough
Although you cannot passthrough the host NVMe as that's what the TrueNAS host is using, you can definitely passthrough a separate drive intended to use under macOS. You can either use this NVMe for the purpose of installing macOS on it or for storing your other data, just like a bare metal install.1. From the TrueNAS Host, select
Virtualization
.2. Select the target Virtual Machine from the Virtual Machines list and click on
Devices
.3. Click on
Add
. A new dialogue box should appear to add the PCI Devices.4. Select
PCI Passthrough Device
from the drop-down menu in the Type
list.5. Select the target
NVMe
in the Search box in the PCI Passthrough Device
list.6. If you want, you can assign a Device Order but it is not mandatory.
7. Click on
Save
.You should see a new PCI Device listed under the Devices list.
8. Restart the TrueNAS Host to make the required changes.
9. Power On macOS VM.
10. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
11. Boot to/into macOS.
You should see the NVMe under macOS now
NOTE:
Do not share the dataset drive (either on the SATA/SAS/NVMe) on the macOS VM. This will cause intermittent freezes and the Virtual Disk on which macOS is installed, couldn't be found either. This is really dangerous.
Disk Passthrough
Other than the macOS virtual boot drive, if you need a separate disk to meet your needs, you can add a virtual disk to your macOS VM, without the need of any other physical disk. Sounds interesting? Let's see howAlthough the disk media is reported as rotational, it is not. The speed is 1462 and 802 MB/s respectively. Whereas, with the VirtIO, the speed is quite fast, similar to a bare metal
If you want to add any disk passthrough to the macOS VM, you can do that without the need for an extra physical disk. The same dataset disk can be used to create a disk passthrough of the desired capacity.
STEP 1: Create a Zvol
1. From the TrueNAS UI, select Datasets from the left pane.
2. From the Datasets window click on Add Zvol. A new dialogue box will appear to add the Zvol.
When at the Add Zvol dialogue box, use the following parameters to create a Zvol:
Zvol name:
Comments:
Size for this zvol:
3. Enter a name for your Zvol name. You can use any. For instance, we'll be using Virtual Disk
4. If you want to add any comment, to describe the Zvol, you can enter it here. We'll be skipping for now
5. Set the required size for the zvol you wish/want to allocate.
6. Depending on the resources and performance, choose one of the disk provisions as described below. We'll choose Thick Provisioning as that's the default option and is highly recommended. You don't need to configure this option unless you want to use Thin Provisioning which is not recommended.
Thick Provisioning
By default, the disk provisioning is set to Thick provisioned. This will allocate all the disk space once you create the Zvol. Although Thick provisioned can take a much longer time to create the virtual disk as compared to Thin Provisioning, it can enhance the performance of the virtual disk as it zeros out all blocks immediately during provisioning and also requires all of the physical disk space to be available right now. This process can be a lot slower and time-consuming if you're low on the hardware resources. If you do not want to allocate all the space now, select Sparse, and the virtual disk starts small and grows as you add data to it. Choose as you would like. We highly suggest using Thick Provisioned, if you do not plan to use a dedicated separate disk for installing macOS.
Thin Provisioning
Thin Provisioning, also known as
Sparse
in TrueNAS. In the Thin Provisioning type, the virtual disk size starts small and automatically grows as you add data to it, to the maximum capacity set during the creation of a Zvol. Unless you're low on resources, we don't recommend using this provisioning type as the performance is quite slow.7. Leave the rest options as it is and click on
Save
.You should see a new Zvol listed under the Dataset node.
STEP 2: Add Virtual Disk to macOS VM
1. From the TrueNAS Host, select
Virtualization
.2. Select the target Virtual Machine from the Virtual Machines list and click on
Devices
.3. Click on
Add
. A new dialogue box should appear to add the Devices.4. Select
Disk
from the drop-down menu in the Type
list.5. Select the target Zvol you want to add in the Search box in the
Zvol
list.6. Select
VirtIO
as mode from the drop down menu.6. If you want, you can assign a Device Order but is not mandatory.
7. Click on
Save
.You should see a new PCI Device listed under the Devices list.
Once you finish adding the disk, restart the TrueNAS Host to make the required changes. Until you restart the TrueNAS Host, you'll not be able to attach the disk to the macOS VM.
9. Power On macOS VM.
10. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
11. Boot to/into macOS.
When we enter the system, the macOS will prompt you to initialize the disk. However, to use the disk under macOS, you'll need to initialize the disk by formatting the virtual disk in a required format which macOS supports.
12. When you get the disk initialization prompt, click on Initialize
13. Select the newly added disk in the Disk Utility and use the following parameters to erase the disk. The new virtual disk will appear as
14. Click on Done. A new disk should appear on your Desktop now.
15. Quit Disk Utility
NOTE:
- Ensure that the Force size option is not checked. By default, the TrueNAS restricts creating a zvol that brings the pool to over 80% capacity. This can lead to a decrease in the pool performance and therefore it is not recommended.
Deleting a Virtual Disk
In case you no longer want to use the Virtual Disk under macOS, you can delete the Zvol to save some disk space for the other VM.1. Boot to macOS
2. Backup your data as necessary.
3. Shut down macOS.
4. From the TrueNAS UI, select
Datasets
from the left pane.5. From the Datasets window select the target Zvol and click on Delete. A new dialogue box will appear to delete the Zvol.
6. When prompted, enter the path for the Zvol. Select the
Confirm
checkbox and click on Delete Zvol
.7. From the TrueNAS Host, select
Virtualization
.8. Select the target Virtual Machine from the Virtual Machines list and click on
Devices
.9. Select the DISK and click on ... and then select Delete. A new dialogue box will appear to delete the Disk.
10. When prompted, select Delete zvol device and enter the Disk name. Select the
Force Delete
checkbox and click on Delete Device
.You should no longer see the target DISK listed under the Devices list.
NOTE:
- Before you delete the Zvol, please ensure you have the necessary backups as it is nearly impossible to recover the data from ZFS once you delete the Zvol.
Results:
Please keep in mind that do not change the NVMe positions, either for the VMware ESXi on which is installed or for the passthrough device. If you do so, the VM will become invalid and the ESXi Server will take a much longer time to boot.
In addition, when doing a storage passthrough, the compatibility for macOS remains the same (i.e. unsupported drives will result in KP)
U.2 Passthrough
The U.2 can be passthroughed like NVMe. If you're using a dedicated HBA/RAID Card, you'll need to install compatible drivers under macOS to enable the support.
III. USB Passthrough
By default, the USB support is absent and does not work under macOS and it is not shared either. Unless you set up a USB passthrough, you can only use the Keyboard and Mouse via Console.Unlike other virtualization platforms (such as), where you'll need at least two USB Controllers for proper use in the VM, you can either individually passthrough either each USB device to the macOS VM or the whole USB Controller (XHCI/EHCI/UHCI) to the macOS VM in TrueNAS. It's quite flexible and you don't have to install a USB PCIe Card just to use USB peripherals (including BT) on a macOS VM.
In order to utilize all the functions of a WiFi Card, WiFi alone is not enough. Bluetooth also needs to function. As Bluetooth is on USB protocol, you must passthrough the USB Controller/Devices so that we can add our Bluetooth Device to macOS. Moreover, using the Keyboard and Mouse, you can have full control of your macOS VM just like a bare metal install.
Individual USB Passthrough
Using the individual USB passthrough method, you can have the USB Devices shared between the TrueNAS Host and the macOS VM (not both at the same time), and a single USB Controller can share different USB Devices as per the need. With the macOS Virtual Machine, you would need a Keyboard, Mouse, and Bluetooth mainly. Moreover, you will not have to map the USB Ports under macOS and that's another advantage.1. From the TrueNAS Host, select
Virtualization
.2. Select the target Virtual Machine from the Virtual Machines list and click on
Devices
.3. Click on
Add
. A new dialogue box should appear to add the Devices.4. Select
USB Passthrough Device
from the drop-down menu in the Type
list.5. Select
qemu-xhci
as Controller Type
from the drop-down menu.6. Select the required USB Device (typically Keyboard, Mouse, and Bluetooth) using the drop-down menu from the
Device
list.7. If you want, you can assign a Device Order but not mandatory.
8. Click on
Save
.You should see a new USB Device listed under the Devices list.
9. Restart the TrueNAS Host to make the required changes.
10. Power On macOS VM.
11. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
Once you start the macOS VM, the Keyboard, and Mouse will start working within the OC menu. When we enter the system, we also find that our all shared USB Devices can be recognized normally. After the USB passthrough, we can use the Keyboard and Mouse to operate the macOS Virtual Machine.
NOTE:
- To add or remove the USB Devices, you must stop the macOS Virtual Machine before you can do that.
Results:
USB Controller Passthrough
Although you can passthrough individual USB Devices to the macOS VM, you may wish to passthrough the USB Controller itself so that all the USB Devices on the host system are available to the macOS VM at once. However, please note that once you start the macOS VM, you'll lose all access to the USB Devices in TrueNAS and all such Devices will be only available under the macOS VM. If you have multiple VMs, a separate USB Controller is required for the USB Passthrough for each VM. This can be very efficient as each VM can occupy one.1. From the TrueNAS Host, select
Virtualization
.2. Select the target Virtual Machine from the Virtual Machines list and click on
Devices
.3. Click on
Add
. A new dialogue box should appear to add the PCI Devices.4. Select
PCI Passthrough Device
from the drop-down menu in the Type
list.5. Select the target USB Controller (XHCI/EHCI/UHCI) in the Search box in the
PCI Passthrough Device
list.6. If you want, you can assign a Device Order but is not mandatory.
7. Click on
Save
.You should see a new PCI Device listed under the Devices list.
8. Restart the TrueNAS Host to make the required changes.
9. Power On macOS VM.
10. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
11. Boot to/into macOS.
After the USB passthrough, we can use the Keyboard and Mouse to operate the macOS Virtual Machine. When we enter the system, we also find that our all USB Devices can be recognized normally.
Results:
IV. Network (NIC) Passthrough
The default network under TrueNAS (VirtIO) is driver-free under macOS as it is being shared. Depending on the NIC speed, the macOS will also have the same speed as the native NIC speed i.e. 1GbE, 2.5GbE, 5GbE, or 10GbE.Onboard NIC
As the Onboard NIC will be occupied by the TrueNAS Server/host, you cannot pass through directly it to macOS. You'll need a separate NIC Card for the passthrough. However, the NIC can be shared and can facilitate the internet function via DHCP configuration. If you have a separate NIC, you can simply install it and enable the NIC passthrough. In case the host has multiple NIC(s), you can enable the passthrough with one of those.1. From the TrueNAS Host, select
Virtualization
.2. Select the target Virtual Machine from the Virtual Machines list and click on
Devices
.3. Click on
Add
. A new dialogue box should appear to add the PCI Devices.4. Select
PCI Passthrough Device
from the drop-down menu in the Type
list.5. Select the target NIC in the Search box in the
PCI Passthrough Device
list.6. If you want, you can assign a Device Order but not mandatory.
7. Click on
Save
.You should see a new PCI Device listed under the Devices list.
8. Restart the TrueNAS Host to make the required changes.
9. Power On macOS VM.
10. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
11. Boot to/into macOS.
NOTES:
- When doing a NIC passthrough, you'll need to install the required driver (.kext) under macOS if your NIC requires an additional driver for macOS, unless the NIC has native support (driver-free) under macOS (such as Intel I225-V). The driver can be obtained from the vendor's site or if the community has already a driver, you could use that. If it requires Device ID spoofing, you'll have to spoof it using either DeviceProperties or SSDT which can be loaded via OpenCore.
10GbE/25GbE/40GbE
As the Onboard NIC will be occupied by the TrueNAS Server/host, you cannot pass through directly it to macOS. You'll need a separate NIC Card for the passthrough. However, the NIC can be shared and can facilitate the internet function via DHCP configuration. Although the network can be shared using the VirtIO (driver name), you may wish to use the high-speed NIC or onboard (such as 10GbE), (if you have one) for fast file transfer sharing, and for that, you'll have to passthrough the specific NIC under macOS.NOTE:
- Due to the unavailability of VT-d under macOS as it is being used by the host system (TrueNAS), you cannot drive NICs which require VT-d. This includes several cards from Aquantia (AQC107, AQC113), Mellanox (), and Intel (I225-V, XL710), etc. For NICs like AQC107, luckily there is a Kernel Patch which can be injected via OpenCore and the NIC can be driven normally as you would on a bare metal machine.
2. Open the config.plist using OCAT
3. Add the following patch under the Kernel>Patch section of your config.plist. In addition, you'll need to specify the MinKernel to 23.0.0 to ensure that the kext is only loaded on macOS Monterey and above.
Arch | Identifier* | Comment | Find | Replace | Mask | ReplaceMask | MinKernel | Count | Enabled |
---|---|---|---|---|---|---|---|---|---|
Any | com.apple.driver.AppleEthernetAquantiaAqtion | CaseySJ - Fix alloc_dma_buffer (including Sonoma) | 4889C741 B8030000 00 | 4889C741 B8130000 00 | F8FFC7FF FFFFFFFF FF | 00000000 00100000 00 | 21.0.0 | 3 | YES |
Any | com.apple.driver.AppleEthernetAquantiaAqtion | CaseySJ - Fix IOBufferMemoryDescriptor::withOptions | BA000000 00BF0000 0000 | BA000200 00BF1300 0000 | FFFF00FF FFFFF0FF FFFF | 00000000 00001000 0000 | 21.0.0 | 3 | YES |
4. Save config.plist
5. Restart macOS
See Network driving cards for more info.
The implementation is the same as AMD Systems as it lacks VT-d which is now a must requirement in order to drive several hardware under newer macOS versions (typically Monterey and later).
Results:
V. WiFi Passthrough
If you're using a WiFi/BT which has native support (driver-free) under macOS, the WiFi should work normally as it would on a bare metal install once you enable the WiFi passthrough. One of the reasons why it is recommended to use hardware that has native support under macOS. Following are the steps to enable WiFi passthrough under macOS:1. From the TrueNAS Host, select
Virtualization
.2. Select the target Virtual Machine from the Virtual Machines list and click on
Devices
.3. Click on
Add
. A new dialogue box should appear to add the PCI Devices.4. Select
PCI Passthrough Device
from the drop-down menu in the Type
list.5. Select the target WiFi in the Search box in the
PCI Passthrough Device
list.6. If you want, you can assign a Device Order but not mandatory.
7. Click on
Save
.You should see a new PCI Device listed under the Devices list.
8. Restart the TrueNAS Host to make the required changes.
9. Power On macOS VM.
10. Reset NVRAM twice to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.
11. Boot to/into macOS.
12. You should see the WiFi under macOS now
The native functions such as App Store, AirDrop, Handoff, and iServices are available and work as expected.
As the Bluetooth function is handled by a USB bus, see USB Passthrough for more info.
As Bluetooth is based on USB protocol, we already passthrough it above. As a result, the WiFi/BT works as expected
Results:
BCM94360NG
BCM94352Z
NOTES:
- If you're on macOS Sonoma, the Broadcom WiFi is broken due to the removal of necessary kexts and as a result, you'll require OCLP to patch the system volume. This applies to every Broadcom WiFi, with or without the native support under macOS. See Enabling Broadcom WiFi on macOS Sonoma for more information.
- If you're not using a WiFi/BT that has native support (driver-free) under macOS (such as BCM94360NG), the requirements are pretty much the same as the bare metal install. One of the examples is BCM94352Z, which requires AirPortBrcmFixup.kext to drive WiFi under macOS and you'll have to use OpenCore to load the kexts under macOS.
- Intel-based WiFi Cards would require OpenCore+Intel WiFi kext and will function normally as it would on a bare metal install. The passthrough steps are similar to Broadcom.
IV. Thunderbolt Passthrough
Finally, it's the Thunderbolt time. Yes, don't be surprised so much. The VM also supports Thunderbolt Passthrough including onboard and AIC.
NOTE:
It should be noted that whatever device(s) require the
VT-d
function, cannot work, at least under macOS due to the unavailability of VT-d. The same applies to the other Operating Systems as well. However, other Operating Systems can work normally.Results:
macOS Updates
The macOS updates can be installed and processed normally, worry-free, just like a bare metal machine with OpenCore Bootloader using the Software Update mechanism from the System Preferences. As always, you must update the OpenCore and the related kexts before applying any updates to the system. See updating macOS for more information.
Updating TrueNAS Host
The TrueNAS updates can be applied to the Host machine normally, as usual. Make sure the host has access to the internet via DHCP and then you can simply update the TrueNAS using System Settings>Update menu. Once the updates are downloaded and ready, reboot the host to process the updates.Troubleshooting
A very fast, stable internet connection is required due to the offline installer. Being an online installer, the installer fetches the InstallAssistant.pkg for the desired macOS version. If there are frequent dropouts, the download will fail and the installation will be terminated with the reason
Validation errors: VM X does not exists
Here, the X could be any VM ID. Make sure you're editing the correct VM. You can get the VM ID using theservice vm query
command in the CLI. Once you get the correct VM IDStuck at [PCI configuration begin] error when booting the macOS Virtual Machine.
Whenever you make any changes in the Virtual Machine, be it either a Graphics Passthrough, a USB Device, or any other PCI Device Passthrough, make sure to restart the TrueNAS Host to avoid the [PCI configuration begin] error when booting the macOS Virtual Machine.No Display/Stuck at TianoCore screen on the connected monitor
If you're using GPU passthrough, make sure to remove the Display Device from the target Virtual Machine. See GPU passthrough for more information.No Virtual Disk in Disk Utility
Once you add the disk (Zvol), restart the TrueNAS Host to make the required changes. Until you restart the TrueNAS Host, you'll not be able to attach the disk to the macOS VM.
Last edited: