Adding a second VM (Mac OS)?


steve1977

Recommended Posts

I am playing with the idea to add a second VM to my Unraid. I already have a well working Win 10 VM, now thinking about a Mac OS VM. I have a few questions:

 

1) Can I run two VM at the same time? If so, what are implications on CPU, GPU and pass-through devices (USB, ethernet)

 

2) Most importantly, what does this mean for audio? I have on-board audio that is connected to speakers. I like to play music from the VM. Does the same soundcard output the system sound from both VMs?

 

3) Descriptions for adding a Mac OS are quite rare and not updated to Unraid 6.3 (only/best I have seen is for 6.1 with remark for changes for 6.2). In contrast, Win 10 VM was dead-simple and nicely documented in the Unraid Wiki. Why is this and can you point me to the best and latest guide?

 

4) Apple upgrades the OS every year (upcoming High Sierra from Sierra). I have not seen any guide for upgrading the VM, but only fresh installs. Is an upgrade difficult or just download & restart?

 

 

Thanks in advance for your help!

Link to comment
3 hours ago, steve1977 said:

1) Can I run two VM at the same time? If so, what are implications on CPU, GPU and pass-through devices (USB, Ethernet)

 

2) Most importantly, what does this mean for audio? I have on-board audio that is connected to speakers. I like to play music from the VM. Does the same soundcard output the system sound from both VMs?

1)  You cannot share hardware between two running VMs.   In this case you need dedicated hardware for each VM that is running simultaneously.   You CAN have hardware that is used by two different VMs as long as they are not running at the same time.   

If you are passing through a USB controller to manage your USB devices then you would need a separate controller for each VM.   If you are doing only the device (as would typically be used for keyboard/mouse type devices) then this is not required but the same device cannot be connected to both VMs at the same time.   There is a plugin you can use for connecting/disconnecting USB devices from a running VM, but this requires a manually action to carry out the switch.

 

2)  The answer to 1) should show that each VM needs its own audio output if you want it handled at the hardware level.

 

Another possibility is to have one of the VMs accessed from the first one using RDP or VNC.   In this case the second VM does not need its own dedicated GPU or sound card and can merely emulate one to make it available to the RDP session..  Depending on how you intend to use the VMs this can be a satisfactory way of running.

Link to comment

Thanks, got it.

 

Your point at the end basically means a VM inside a VM? Assume this will be challenging from a performance perspective? Unraid would need to emulate Win10 that then again needs to emulate Mac OS? Doesn't sound like I am setting up things for success.

 

Maybe let me share what I'd like to do. I am happy with my Win10 VM, which is running 24/7. However, I'd like to use Apple Photos that only runs on Mac OS.

Link to comment
12 minutes ago, steve1977 said:

Your point at the end basically means a VM inside a VM? Assume this will be challenging from a performance perspective? Unraid would need to emulate Win10 that then again needs to emulate Mac OS? Doesn't sound like I am setting up things for success.

No.  What this means is that you open a session on the first VM that acts as the screen/keyboard (running in a Window on the first VM) to the second VM which is running independently.   This is the same thing you do with physical PCs when you want one to be able to remotely act as the screen keyboard on another one.   This gives slightly lower graphics performance than having a dedicated GPU, so is not ideal for gaming, but if you do not intend to run games on the second VM this is probably not a serious issue.

Link to comment

Not fully sure I understand. I am running Unraid headless. So, I am using Remote Desktop from a notebook to access Unraid (web interface) and use Remote Desktop to access the first VM. So, I am using the keyboard from my notebook. In my case, how could I access the second VM (assuming I don't want to stop the first). Do I need to use remote desktop to access the first and then another remote desktop within the 1st to access the 2nd?

Link to comment

Not sure how you can be using Remote Desktop to access the unRAID GUI - you would normally just be running a web browser session.   This on the basis that Remote Desktop refers to an app rather than being a generalised term for running a VM remotely.

 

I had originally assumed that you had the Windows VM set up so that you were doing hardware passthru of the unRAID GPU so were using a monitor directly attached to the unRAID server.  This was because you were asking about GPU. Etc.   If running via Remote Desktop then you are emulating such devices rather than using a real physical GPU.  

 

If you are already using Remote Desktop from another machine to access VMs then you can use separate instances to access each VM.   In this case you might find it useful to install the Microsoft Remote Desktop Manager as it makes it easier to handle multiple RDP sessions.   In this case you set each VM up to have its own IP address and have the Remote Desktop server feature activated inside the VM.  If you are using Remote Desktop then this should also handle sound coming out at the laptop end.

 

Another way to access VMs on unRAID is instead to use VNC.   At first glance this might be appear to be the same as Remote Desktop but under the covers it is using a different technology.   In this case the VMs are accessed via the unRAID IP address, with the port used being the one appropriate to the VM being accessed.  In this case the VMs are not aware they are being accessed remotely.  If you want to operate this way then I would recommend using realVNC as the software you use on the laptop as this gives the best performance using VNC and also provide easy management of multiple VNC sessions.   It. Is also possible to run VNC via a browser (support for this is built into unRAID) but this tends to perform significantly worse than doing it via a VNC app installed locally on the laptop.

 

Of the two options using Remote Desktop gives the better performance but VNC is easier to set up and manage.

 

 

 

Link to comment

Thanks.

 

Yes, you are right. I of course don't run Unraid GUI via Remote Desktop. I just do this via the web interface. No clue why I wrote differently above.

 

I indeed use "Remote Desktop Connection" as dedicated software to access my Win10 VM. It goes very well and no issues at all. I was unaware that this means that I am not even using the GPU. I assume I still use the "server" CPU, Ram and I have access to the USB ports. How is sound handled?

 

If I read you correctly, I can indeed just run two VMs as long as I continue to access them via Remote Desktop? I am less concerned about having the two Remote Desktop Connections open at the same time, but I'd like the two VMs to be running all the time. Also, I'd like to use the "server" soundcard to output to a speaker connected to the "server" (not the notebook). Would this be possible? If so, assume this would only work for one of the two VMs, but the other one would still have sound on my notebook when accessed through Remote Desktop?

Link to comment

 

8 hours ago, steve1977 said:

I indeed use "Remote Desktop Connection" as dedicated software to access my Win10 VM. It goes very well and no issues at all. I was unaware that this means that I am not even using the GPU. I assume I still use the "server" CPU, Ram and I have access to the USB ports. How is sound handled?

 

Yes you are using the server CPU and RAM.   My server does not support hardware passthrough so I am using only an emulated GPU.   I am not sure if you get better graphics performance in RDP if you have a real physical sound card assigned to a VM.  In my case this is never the case as my hardware does not support passing through a GPU to a VM.

 

I am not quite sure how unRAID handles sound cards as I do not have one installed in my server. 

Instead I also the following lines to my VMs (via the Edit XML option)

<sound model='ac97'>    </sound>

to give me an emulated sound card.  If I set this as the default sound output inside the VM I can get sound through the RDP session.  The annoying thing about unRAID (at the moment) is that if you use the VMs Edit option this is lost and has to be re-applied via the Edit XML option. 

 

8 hours ago, steve1977 said:

If I read you correctly, I can indeed just run two VMs as long as I continue to access them via Remote Desktop? I am less concerned about having the two Remote Desktop Connections open at the same time, but I'd like the two VMs to be running all the time. Also, I'd like to use the "server" soundcard to output to a speaker connected to the "server" (not the notebook). Would this be possible? If so, assume this would only work for one of the two VMs, but the other one would still have sound on my notebook when accessed through Remote Desktop?

You can run as many VMs as you like as long as your server has enough CPU and RAM to run them simultaneously.   RAM is dedicated to a VM while it is running (including a small overhead per VM to handle emulating devices), but CPU resources can be shared.   I personally always leave CPU 0 free for unRAID use, and I map my CPU usage to VMs so that my important VMs have their own dedicated CPUs (avoiding CPU 0)

 

I cannot answer your question about sound as my hardware does not have a sound card so anything I say would be based on hearsay from other ports.  I can only suggest trying it to see what happens.   I can see there potentially being problems about passing the sound hardware through to a VM but it is always possible this is a non-issue.

 

I normally set up my VMs so that each one uses a unique port for VNC by changing the line in the XML which specifies the VNC details by changing the autoport to 'no' and the port to the one I want dedicated to this VM.   This allows me to set up realVNC on my remote system to have a pre-prepared connection for each VM which makes it very easy to manage them.   I always use VNC for initial setup as not all VMs I use can support RDP.  Like the tweak above for an emulated sound card this change is lost if you use the VMs Edit option and has then to be re-applied via the Edit XML option.   This is strange as the GUI quite happily displays the result after you make the change.   For my Windows VMs I have installed Microsoft Remote Connection Manager so that again I can have pre-prepared Connection setups for the VMs I access via RDP.

 

For USB devices I use the 'Libvirt Hotplug USB' plugin which allows me to dynamically connect/disconnect USB devices that are attached to the server to a specific running VM.  This plugin adds an extra section to the VM tab for handling this.  I tend to use this for things like a USB attached hard drive that I want a specific VM to use for a short while.   From what I have seen in the forum whether this is a satisfactory solution seems to depend on the type of USB hardware.    For some types of USB device it appears you need pass through USB controller hardware to get satisfactory results.

 

I also use the VirtualHere software to allow a remote USB device (which I have attached to a Raspberry Pi) to be used by a VM, although in this case the VirtualHere software has to be installed inside the VM and also at the remote host for the USB device.  For my purposes the 'free' VirtualHere license is sufficient although I will be quite happy to switch to a paid license if my needs increase.

 

Hope some of the above helps?

 

Link to comment

All of above helps. This is superb. Thanks a lot! Unfortunately (for you), it is so insightful that it leads to quite some follow-up questions:

 

1) I only have one CPU, but it has 4 Cores. It is not the latest model, but a solid i5. I had always assigned all four cores to my VM. I am reading now that there may be some advantages to only assign core 1-3 to the VM and leave core 0 dedicated to Unraid. I like the idea and assume the VM will do fine with three cores. Before I switch, let me understand though what will be the advantage in terms of Unraid. For transparency, my Unraid needs to manage a 16-disk array with 80TB (one parity disk), but not running any dockers as I find it easier through the VM. In my use case, does it make sense to assign one core exclusively to Unraid (and 3 to the VM)

 

2) If I were to start a second VM, does it make sense to have the 3-4 same cores to both VMs or any advantage of having one exclusive to one and 2-3 exclusive to the other VM?

 

3) Sound is a big topic for me, so let me make sure that I understand things correctly. I currently have audio through the Remote Desktop when playing music in my VM. This is good and I'd like to keep it. For the second VM, I'd like to output the sound not within Remote Desktop (on my notebook), but to speakers attached to the server. Would this require to passthrough the soundcard? I assume yes. if so, is it better / possible to do so with both VMs or just with one? Is it even possible? Techically, my "soundcard" is jst something on the mobo and nothing fancy.

 

4) I'd like to use VNC, but there is a bug with Unraid preventing it directly from Unraid (some touchscreen issue, which is known to the developers, but not fixed yet). There should not be any major disadvantage using Remote Desktop instead of Unraid native VNC Or do I miss anything?

 

5) Does Mac OS even support Remote Desktop? I thought so, but you mention that some of your VMs do not support it?

 

6) I really like the idea of Virtualhere and it may solve an existing issue (with just one VM). Currently, I cannot hotswap devices attached to USB in the VM (always need to shutdown, assign, start again). Would Virtualhere solve this issue? Could I use the Rpi to attach USB devices (harddisks, pen drives, iphones, ipad, etc.) that could be accessed from one or several VMs and can be hotswapped? This would be a very good workaround for Unraid unavailability for hotswap?

 

 

Thanks again for your help. Much appreciated.

Link to comment
On ‎19‎/‎09‎/‎2017 at 5:21 AM, steve1977 said:

1) I only have one CPU, but it has 4 Cores. It is not the latest model, but a solid i5. I had always assigned all four cores to my VM. I am reading now that there may be some advantages to only assign core 1-3 to the VM and leave core 0 dedicated to Unraid. I like the idea and assume the VM will do fine with three cores. Before I switch, let me understand though what will be the advantage in terms of Unraid. For transparency, my Unraid needs to manage a 16-disk array with 80TB (one parity disk), but not running any dockers as I find it easier through the VM. In my use case, does it make sense to assign one core exclusively to Unraid (and 3 to the VM)

UnRAID is always going to need some CPU time to manage it's NAS duties and also carrying out emulation on behalf of any VMs.   in your current setup where the single VM seems to be the main use it may not matter much.   The more VMs you run and the more varied the workload at the unRAID level the more dedicating a core is likely to be best for overall performance.   It is a relatively trivial operation to change the cores allocated to a VM so you can easily experiment with different allocation of vCPUs to VMs.

 

2) If I were to start a second VM, does it make sense to have the 3-4 same cores to both VMs or any advantage of having one exclusive to one and 2-3 exclusive to the other VM?

 

Difficult to say.  it will depend on the exact workload each VM is running and how you are using them.   All I can advise is try different allocations of cores and see how it works for you. 

 

On ‎19‎/‎09‎/‎2017 at 5:21 AM, steve1977 said:

3) Sound is a big topic for me, so let me make sure that I understand things correctly. I currently have audio through the Remote Desktop when playing music in my VM. This is good and I'd like to keep it. For the second VM, I'd like to output the sound not within Remote Desktop (on my notebook), but to speakers attached to the server. Would this require to passthrough the soundcard? I assume yes. if so, is it better / possible to do so with both VMs or just with one? Is it even possible? Techically, my "soundcard" is jst something on the mobo and nothing fancy.

 

As I said earlier I cannot help with this scenario as my hardware dies not support it.

 

On ‎19‎/‎09‎/‎2017 at 5:21 AM, steve1977 said:

4) I'd like to use VNC, but there is a bug with Unraid preventing it directly from Unraid (some touchscreen issue, which is known to the developers, but not fixed yet). There should not be any major disadvantage using Remote Desktop instead of Unraid native VNC Or do I miss anything?

 

Just to clarify are you talking about the NoVNC client accessible via the unRAID GUI or a free-standing VNC client?   I have always found NoVNC to be unreliable and using a free-standing client (which is where realVNC comes into play on my system).

 

On ‎19‎/‎09‎/‎2017 at 5:21 AM, steve1977 said:

5) Does Mac OS even support Remote Desktop? I thought so, but you mention that some of your VMs do not support it?

it does but you have to get it installed and running before y/u can activate it (just like with a Windows VM)

 

On ‎19‎/‎09‎/‎2017 at 5:21 AM, steve1977 said:

6) I really like the idea of Virtualhere and it may solve an existing issue (with just one VM). Currently, I cannot hotswap devices attached to USB in the VM (always need to shutdown, assign, start again). Would Virtualhere solve this issue? Could I use the Rpi to attach USB devices (harddisks, pen drives, iphones, ipad, etc.) that could be accessed from one or several VMs and can be hotswapped? This would be a very good workaround for Unraid unavailability for hotswap?

 

Have you actually tried the 'Libvirt Hotplug USB' plugin to manage this - I use it all the time for just this purpose for USB devices plugged into the unRAID server.   When using the plugin key points are

  • it controls USB devices that are physically plugged into the unRAID server
  • You do not assign the device in your XML
  • If it is a storage device it must not currently be mounted by the Unassigned Devices plugin.  This may mean you have to tell the 
    UD plugin to unmount it before trying to assign it to the VM.

The Use Case for Virtualhere is slightly different.   It is used when you want the USB device to be plugged into a machine that is remote to the unRAID server.   To avoid having an extra machine involved this can be the machine running the RDP/VNC client you are using to access a VM.  I mentioned a Raspberry Pi because this is what I am often using go run my RDP/VNC clients so is the case I have tested.

 

Link to comment
  • 3 weeks later...

Thanks. This is great advice. It does include quite a few great pointers to help me out.

 

I realized that dropping 1-2  cores from my VM quite significantly impacts is performance. So, I will keep it to four and try to run the second VM also with four. Let's see how this impacts performance. What's the worst case situation for Unraid? Crashes? Or something more material when it comes to parity or data security?

 

I still haven't created the second VM, but will do so soon.

 

What you are sharing about USB is quite intriguing. I am not satisfied about current use of USB devices and it feels that I am not using is as well as Unraid can support this yet? I don't care about mounting USB storage to Unraid, but only use USB storage et al within my VM(s). Some more questions regarding use of USB:

 

1) I am not using the 'Libvirt Hotplug USB' yet. Once I have this installed, I no longer need to go add and remove USB devices manually in the VM settings? Instead, I can just add and remove the USB devices (hot-swap) and the VM will pick it up. So, this plugin will make the VM act like a normal stand-alone computer in terms of USB use?

 

2) When having 'Libvirt Hotplug USB' installed, can I use the USB ports in two VMs? For example, I may want to add a USB storage device and can access it via both VMs?

 

3) How does now Virtualhere come into game? I am accessing my VM(s) remotely with a notebook via Remote Desktop. Does Virtualhere allow me to access USB devices connected to my notebook within the VM? If so, this would be true magic and great. How to set this up? Just install Virtualhere on my notebook and it works?

Link to comment
4 hours ago, steve1977 said:

1) I am not using the 'Libvirt Hotplug USB' yet. Once I have this installed, I no longer need to go add and remove USB devices manually in the VM settings? Instead, I can just add and remove the USB devices (hot-swap) and the VM will pick it up. So, this plugin will make the VM act like a normal stand-alone computer in terms of USB use?

Yes.

 

the only caveat is that if you have the UD plugin installed you have to check that UD has not mounted the USB drive as that stops it being passed to a VM

 

4 hours ago, steve1977 said:

2) When having 'Libvirt Hotplug USB' installed, can I use the USB ports in two VMs? For example, I may want to add a USB storage device and can access it via both VMs?

 

Not at the same time.   If you think of each VM as though it were a PC then you cannot have the same USB device plugged into two PCs at the same time.

it could, however, be connected to 0ne and made available to the other via a network share.

The libvirt plugin gives you the ability to disconnect it from one VM and then connect it to the other (simulating unplugging it from one PC and plugging it into another.

 

4 hours ago, steve1977 said:

3) How does now Virtualhere come into game? I am accessing my VM(s) remotely with a notebook via Remote Desktop. Does Virtualhere allow me to access USB devices connected to my notebook within the VM? If so, this would be true magic and great. How to set this up? Just install Virtualhere on my notebook and it works?

Yes, this is exactly what it does.   You need the VirtualHere server installed on the notebook and the VirtualHere client installed in the VM.   Details are on the VirtualHere site.

Link to comment

Thanks, this is great!
 

re 1 - what is UD? Unraid? If so, Unraid does not auto-mount anything, does it?

 

re 2 - how to "assign" what VM it is assigned to? If I understand the livirt hotplug correctly, I no longer need to "mount" USB devices in the XML file for the specific VM. Do I still "assign" USB ports? Or is it "first come first use"?

 

re 3 - very cool. That's a great thing and will be primary use case. Would still be good to have the option with libvirt, so questions 1 and 2 remain relevant.

Link to comment

1). UD = Unassigned Devices plug-in.

 

2). With libvirt plugin you when you want to connect a device you specify the usb device and the target VM at the time you connect them.   Think of this as equivalent to plugins in a usb device to a PC.    When you have the libvirt plugin installed then a section for controlling this is added to the VM tab.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.