Jump to content
RobJ

VM FAQ

44 posts in this topic Last Reply

Recommended Posts

So I'm on unRAID 6.4 and have a new Windows 10 VM. Followed the other steps but it says that an address type cannot be "drive" so I cannot change these settings.

I changed everything but left address type as 'pci' and it still shows as a normal hard disk instead of a thin provisioned drive. Any advice on what to change it to instead of pci?

I never did this on v6.4, looks like something changed, will have a look when I have the time.

 

 

Share this post


Link to post
Just now, johnnie.black said:

I never done this on v6.4, looks like something changed, will have a look when I have the time.

 

No problem! It wouldn't even let me save the XML at all so it's on PCI and all the other settings/drivers/etc are all there. 

Share this post


Link to post

With unRAID 6.4, is it recommended to update all the VirtIO drivers for any existing VMs created back around the release of 6.0? Mine seem to be running fine as is, but I wasn't sure if the newer ones offer better performance or improve something.  Thanks.

Share this post


Link to post
On 7/19/2018 at 4:38 PM, nekromantik said:

Is clipboard sharing between PC and KVM VM on Unraid not possible?

Might not be correct, but I thought this can be done via a third party app called splashtop.

Share this post


Link to post
Is clipboard sharing between PC and KVM VM on Unraid not possible?

Microsoft RDP does this real well with Windows VM's

 

Note FAQ is reserved and wasn't meant for support. Mods feel free to clean this up.

Share this post


Link to post
1 hour ago, nekromantik said:

Thanks both.

Will check splashtop.

I am not running Windows VM so cant use RDP.

Look at NoMachine vs SplashTop.

Share this post


Link to post
Posted (edited)

Why are you constantly assuming we all use VM's to run Windows instances? Please provide examples how to do the exact same for Linux VM's.

Edited by fluisterben

Share this post


Link to post

I changed the disk-size in Unraid's UI of an Ubuntu mini sourced VM I've setup as a server for various things, and now the VM has no network whatsoever. What's up with that? If changing disk-size has this effect on a basic ubuntu VM, I would not qualify unraid as 'stable' or something to 'sell', to be honest (I'm 7 days into using the trial). Also, I noticed that its disksize is still not expanded, when I connect via VNC and check on this VM, it's still showing its old size. While the Unraid UI says it has 20GB, df -h shows me it only has 12GB still.

Share this post


Link to post
58 minutes ago, fluisterben said:

Why are you constantly assuming we all use VM's to run Windows instances? Please provide examples how to do the exact same for Linux VM's.

I have used both NoMachine and RDP with Linux VMs so I would say those suggestions are both relevant.

Share this post


Link to post
2 minutes ago, fluisterben said:

I changed the disk-size in Unraid's UI of an Ubuntu mini sourced VM I've setup as a server for various things, and now the VM has no network whatsoever. What's up with that? If changing disk-size has this effect on a basic ubuntu VM, I would not qualify unraid as 'stable' or something to 'sell', to be honest (I'm 7 days into using the trial). Also, I noticed that its disksize is still not expanded, when I connect via VNC and check on this VM, it's still showing its old size. While the Unraid UI says it has 20GB, df -h shows me it only has 12GB still.

I have changed the vdisk size on VMs without the effect on the network that you describe.   I expect that there is something else going on in your case.

 

i would not expect the ‘df’ command to show anything different until you have run an appropriate partition management tool (e.g. gparted) inside the VM under Linux.     Unraid may increase the physical size of the emulated disk but it will not touch the partitions/file systems on the vdisk - that is up to the VM to do so.

Share this post


Link to post

@fluisterben If you have custom edits inside the xml for your network lets say changing the model of the emulated device, these changes will be lost if you change something else in the VM settings. Keep that in mind. As stated from itimpi increasing the vdisk size in the webui doesn't change the filesystem size inside the VM. You have to expand the partion inside the VM by yourself. Also to be mentioned and been documented in Unraids wiki, never decrease the vdisk size or you will break your VM if sectors of the vdisk are used by the VM and you cut them off. 

Share this post


Link to post
Posted (edited)
1 hour ago, bastl said:

@fluisterben If you have custom edits inside the xml for your network lets say changing the model of the emulated device, these changes will be lost if you change something else in the VM settings. Keep that in mind. As stated from itimpi increasing the vdisk size in the webui doesn't change the filesystem size inside the VM. You have to expand the partion inside the VM by yourself. Also to be mentioned and been documented in Unraids wiki, never decrease the vdisk size or you will break your VM if sectors of the vdisk are used by the VM and you cut them off. 

I have done nothing out of the ordinary with this VM, no xml editing, I don't even know where those xml files are located. Funny thing is: I tried expanding the disk size internally, but it needs network access to install the required apps for that to work. So yeah, catch 22 there.

Also; Is there a VNC access tool that actually copy pastes from and into the terminal window? The Remote VNC included with Unraid does not do that. Really annoying.

 

I tried the virt-manager docker in hopes to change network settings for the VM, installed it, but it doesn't connect to anything, doesn't prompt me to do anything, it's basically a tool for advanced users without proper docs. Must say I really expected more from Unraid and its VM Manager, or its plugins/apps.

Edited by fluisterben

Share this post


Link to post
3 hours ago, bastl said:

@fluisterben Try to create a fresh VM and point it at your existing vdisk.

Tried that, still no network access. Seems to be something inside the Ubuntu guest that causes the network to fail. I've just recreated an entire VM with the exact same properties, but starting with a larger disk, same problem.

 

I'll now create a new fresh VM, from scratch, and will check each step and see where it goes wrong. May be of interest to other users..

Share this post


Link to post
Posted (edited)

OK, figured out after which change network fails, as soon as I add a mount (fill in under the Edit VM setup);

 

Unraid Share:

Unraid Mount tag:

 

at next boot of the VM, network iface is down. After checking the XML, this is what it does;

    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/mnt/user/nxt/'/>
      <target dir='/nxt/'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </filesystem>
    <interface type='bridge'>
      <mac address='52:54:00:57:cb:d9'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
    </interface>

note that it changed bus=0x01 into bus=0x03 for the network interface.

Changing that back to 0x01 for the network interface fixed network, but the mount does not seem to work when I change that bus to 0x03, or that may not be the reason, don't know yet.

Edited by fluisterben

Share this post


Link to post
Posted (edited)

@fluisterben Check if this works for you 

 

I had no issues setting this up in a Mint VM. XML looks like the following

    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/mnt/user/downloads/dl'/>
      <target dir='dl'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </filesystem>
    <interface type='bridge'>
      <mac address='52:54:00:e0:e7:31'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
    </interface>

 

Edited by bastl

Share this post


Link to post
On 4/29/2017 at 8:03 AM, johnnie.black said:

How do I keep my sparse vdisk as small as possible?

How do enable trim on my Windows 8/10 or Windows Server 2012/2016 VM?

 

By default vdisks are sparse, i.e., you can chose 30GB capacity but it will only allocate the actual required space and use more as required, you can see the current capacity vs allocated size by clicking on the VM name, problem is that over time as files are written and deleted, updates installed, etc, the vdisk grows and it doesn't recover from the deleted files.

 

This has two consequences, space is wasted (doesn't matter if the vdisk is on an SSD or HDD) and if the vdisk in on an SSD that unused space is not trimmed, it's possible to "re-sparsify" the vdisk e.g., by cping it to another file, but this it's not very practical and there's a better way.

 

You can use the vitio-scsi controller together with discard='unmap', this allows Windows 8/10 to detect the vdisk as "thin provisioned drive", and any files deleted on the vdisk are immediately recovered as free space on the host (again both on an SSD or HDD), and this also allows fstrim to then trim those now free sectors when the vdisk is on an SSD.

 

On an existing vdisk it's also possible to run Windows defrag to recover all unused space after changing to that controller.

 

Steps to change an existing Windows8/10 VM (also works for Windows Server 2012/2016):

 

1) First we need to install the SCSI controller, shutdown the VM (For Windows 8/10 I recommend disabling Windows fast Startup -> Control Panel\All Control Panel Items\Power Options\System Settings before shutdown, or else the VM might crash on first boot after changing the controller).

 

Then edit the VM in form mode (toggle between form and XML views is on the upper right side), and change an existing device other than your main vdisk or virtio driver cdrom to SCSI, for example your OS installation device if you still have it, if not you can also add a second small vdisk and chose SCSI as the vdisk bus, save changes

 

2) Start the VM and install the driver for the new "SCSI controller", look for it on the virtio driver ISO (e.g., vioscsi\w10)

 

3) Shutdown the VM, edit the VM again, again using the form view and change the main vdisk controller to "SCSI", now change view to XML and add "discard='unmap'" to the SCSI controller:

 

Add after cache='writeback', e.g. before:

 

 

After:

 

 

4) Start the VM (if you added a 2nd vdisk you can remove it now before starting), it's should boot normally, you can re-enable Windows fast startup.

 

5) Run Windows Defrag and Optimize drives, check that he disk is now detected as "Thin provisioned drive" and run optimize to recover all previous unused space.

 

From now on all deleted files on the vdisk should be immediately trimmed.

 

Note: If after this you edit the VM using the GUI editor these changes will be lost and will need to be redone.

 

Do I need to add the discard='unmap' if I'm passing the physical disk to unraid?

Share this post


Link to post

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.