RobJ

VM FAQ

Recommended Posts

This TOC is broken, at least for now. See the "repaired" TOC here:

 

Something seems to have broken the links that were imported from the old forum software. 

 

 

__________________________________________________________________________________________________________________

 

This thread is reserved for Frequently Asked Questions, concerning everything that's VM related on unRAID, their setup, operation, management, and troubleshooting.  Please do not ask for support here, such requests and anything off-topic will be deleted or moved, probably to the VM FAQ feedback topic.  If you wish to comment on the current FAQ posts, or have suggestions or requests for the FAQ, please put them in the VM FAQ feedback topic.  Thank you!

 

Note: there are lots of graphics, allow your browser extra time!  Each page may jump around some as it loads.


 

Getting Started

General Questions

Maintenance and Troubleshooting


 

unRAID FAQ's and Guides -

* Guides and Videos - comprehensive collection of all unRAID guides (please let us know if you find one that's missing)

* FAQ for unRAID v6 on the forums, general NAS questions, not for Dockers or VM's

* FAQ for unRAID v6 on the unRAID wiki - it has a tremendous amount of information, questions and answers about unRAID.  It's being updated for v6, but much is still only for v4 and v5.

* Docker FAQ - concerning all things Docker, their setup, operation, management, and troubleshooting

* FAQ for binhex Docker containers - some of the questions and answers are of general interest, not just for binhex containers

* VM FAQ - a FAQ for VM's and all virtualization issues

 

Know of a question that ought to be here?  Please suggest it in the VM FAQ feedback topic.

 

-------------------------------------------------------

Suggested format for FAQ entries - clearly shape the issue as a question or as a statement of the problem to solve, then fully answer it below, including any appropriate links to related info or videos.  Optionally, set the subject heading to be appropriate, perhaps the question itself.

 

While a moderator could cut and paste a FAQ entry here, only another moderator could edit it.  It's best therefore if only knowledgeable and experienced users create the FAQ posts, so they can be the ones to edit it later, as needed.  Later, the author may want to add new info to the post, or add links to new and helpful info.  And the post may need to be modified if a new unRAID release changes the behavior being discussed.

 

Moderators:  please feel free to edit this post.

Edited by trurl
Link to repaired TOC

Share this post


Link to post
Share on other sites

How do I get started using unRAID VMs ?

 

Things to read -

 

** VM  Basics,  A brief synopsis of KVM, HVM, and VFIO by Jonp

    http://lime-technology.com/forum/index.php?topic=38689

 

** VM, Guide/Manual,UnRAID 6/VM Management -- Offical Limetech guide to VM management

    http://lime-technology.com/wiki/index.php/UnRAID_6/VM_Management#Using_Virtual_Machines

 

 

Things to watch -

 

** VM Guide - An introduction to unRAID VMS in unRAID 6.2.3 and what to do first. by gridrunner

    Thread  http://lime-technology.com/forum/index.php?topic=53573.0

 

 

 

** VM Guide - Enabling VM management in unRAID 6 by jonp

 

 

 

Share this post


Link to post
Share on other sites

Can I convert my VMWare virtual machine to run on unRAID ?

 

Things to watch -

 

** VM Guide- Pre built Win10 VM and Convert VMWare to KVM on unRAID by jonp

 

Share this post


Link to post
Share on other sites

What kind of performance can I expect from a VM ?

 

Things to read -

 

**Article - Gaming on a NAS? You better believe it! Limetech website

http://lime-technology.com/gaming-on-a-nas-you-better-believe-it/

 

Things to watch -

 

** VM benchmark/demo - 3 Gamers, 1 mATX Motherboard, 1 CPU and various benchmarks. by gridrunner

    forum link http://lime-technology.com/forum/index.php?topic=53169.0

 

 

** VM benchmark/demo -Physical vs. Virtual Machine - 3D Mark Benchmark Comparison by jonp

 

Share this post


Link to post
Share on other sites

There is not a template for OS X. Can I create an OS X VM?

 

 

Things to read -

 

** VM Guide  Mac OS X 10.11 El Capitan – VM on unRAID by archedraft

    https://macosxvirtualmachinekvm.wordpress.com/guide-mac-os-x-10-11-el-capitan-vm-on-unraid/

    Forum link    http://lime-technology.com/forum/index.php?topic=43816.0

 

Things to watch -

 

    Forum link for below videos http://lime-technology.com/forum/index.php?topic=51915.0

 

** VM Guide Installing OS X using seabios by gridrunner

 

 

** VM Guide Installing OS X using OVMF by gridrunner

 

 

** VM Guide Installing OS X 10.12 Sierra in unRAID with OVMF and Clover by gridrunner

 

Share this post


Link to post
Share on other sites

Whilst installing Windows 7 VM I'm getting stuck at the "Starting Windows" screen ?

 

When installing Windows 7 it is best to set the vnc video driver, graphics type to 'cirrus'

 

You will not see this option until you togle the advanced view

 

Screen_Shot_2016_11_09_at_15_50_07.png

 

Then you will see the option to change graphics type

 

Screen_Shot_2016_11_09_at_15_50_35.png

 

** forum link http://lime-technology.com/forum/index.php?topic=53346.msg512381#msg512381 

Share this post


Link to post
Share on other sites

Why cant I get a network connection or the wrong IP in my VM?

 

Scenario 1 Windows VMs

 

If you have a problem with a windows vm then it is probably because windows needs to have virtio drivers (the same drivers that you used when installing the VM) installed for the network adaptor.

 

Screen_Shot_2016_11_09_at_16_34_18.png

 

Scenario 2 All  VMs

 

If you are getting an unexpected IP address in your VM and cant see it in your local network, then you may not have the network type set as a NAT bridge (virbr0). That will mean the VM is not visible on the local LAN. The check this toggle the advanced tab.

 

Screen_Shot_2016_11_09_at_15_50_07.png

 

Then check that the network type is set to 'br0'

 

Screen_Shot_2016_11_09_at_16_26_29.png

 

Scenario 3  OS X  VMs

 

OS x needs to have the network adaptor type set to  <model type='e1000-82545em'/> in order to be compatible with the OS.

 

If you find that you network was working fine one day and not the next. Have you been editing the xml of the vm?

Because as well as having the correct type, it must be assigned the address below.

 

<address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>

 

This is because OSX fails to detect network link unless we manually move the network card to a separate hardware IRQ line away from the AHCI/SATA controller.

 

Share this post


Link to post
Share on other sites

I dont have onboard graphics. Can I pass-through my GPU in the primary slot 1?

 

Yes you can pass-through a GPU in your primary slot when you dont have onboard graphics. Nvidia cards need to have the rom file

passed through to the VM for this to work.

 

Things to read -

 

** VM forum guide by hupster

http://lime-technology.com/forum/index.php?topic=43644.msg452464#msg452464

 

Things to watch -

 

** VM Guide - How to passthrough an nvidia gpu as primary gpu in unRAID by gridrunner

    forum link - http://lime-technology.com/forum/index.php?topic=52960.msg509057#msg509057

 

  • Upvote 1

Share this post


Link to post
Share on other sites

I have a VM with custom xml edits. Is there a way to use the GUI to make changes without loosing the custom edits?

 

Unfortunately with the unRAID VM manager you must be careful. You can view things in the VM manager, but any changes made with the GUI will remove custom xml edits.

 

There is a way around that. This is to use virt-manager as an alternative VM manager for use with your custom edited VMs.

 

Things to watch -

 

** VM Guide - How to connect virt-manager to unRAID to help manage your VMs by gridrunner

    forum post - http://lime-technology.com/forum/index.php?topic=53443.0

 

 

 

 

Share this post


Link to post
Share on other sites

I passed-through my graphics card to a VM but now i cant see the unRAID console on my monitor. Why is this?

 

This is normal and to be expected. It only occurs when you pass-through the GPU that unRAID uses to display console (Primary).

You can still access the server by the web interface, telnet or ssh so really isn't a problem for most.

On reboot of the server, the console will return until that GPU is used in a VM again.

This does not occur if you pass-through a GPU that isn't used to display the unRAID console.

Share this post


Link to post
Share on other sites

Ok, so I have made a few VMs but how do I back them up?

 

Things to read -

 

** VM Forum guide -Automatic backup script by danioj  http://lime-technology.com/forum/index.php?topic=47986.0

 

Things to watch -

 

**  VM video guide - How to manually backup and restore unRAID VMs by gridrunner

 

 

** VM video guide - How to automatically backup unRAID VMs vdisks and xml files by gridrunner

 

 

  • Upvote 1

Share this post


Link to post
Share on other sites

I want to install windows 10 on unRAID where do i get started and is there anything i should do post install?

 

Things to watch -

 

** VM Video guide - Installing a Windows 10 Virtual Desktop on unRAID 6 by jonp

 

 

Share this post


Link to post
Share on other sites

How do I pass through a USB controller so i can hotswap in my vm ?

 

Things to read -

 

** ***GUIDE*** Passthrough Entire PCI USB Controller by archedraft

http://lime-technology.com/forum/index.php?topic=36768.0   

 

Things to watch -

 

**VIDEO GUIDE** How to easily and safely pass through a USB controller **  by gridrunner

    Thread  http://lime-technology.com/forum/index.php?topic=54753

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

How can I pass through a physical Network controller to a VM?

 

Things to read -

 

** ***GUIDE*** Passing Through Network Controllers to unRAID 6 Virtual Machines by jonp

http://lime-technology.com/forum/index.php?topic=39638 

 

Things to watch -

 

**VIDEO GUIDE** How to isolate then pass-through a Network Controller in unRAID*  by gridrunner

Thread  http://lime-technology.com/forum/index.php?topic=54937.0

 

 

 

 

Share this post


Link to post
Share on other sites

How do I create a vdisk snapshot on a btrfs device?

 

There are two methods of creating instant copy/snapshot with btrfs, if it's a single file like a vdisk use the first one, if you want to snapshot an entire folder use the 2nd, e.g., I have all my VMs in the same folder/subvolume so with a single snapshot they are all backed up instantly.

 

Method 1 - Creating a reflink copy:

 

Simple way for making an instant copy of a vdisk creating a reflink copy, which is essentially a file-level snapshot:

 

cp --reflink /path/vdisk1.img /path/backup1.img

 

Requirements:

Both the source and destination file must use the same BTRFS volume, can be a single device or pool.

Copy-on-write on (enable by default)

 

 

Method 2 - Snapshot:

 

Btrfs can only snapshot a subvolume, so first thing we need to do is create one, example below uses the cache device, it can also be done on an unassigned device adjusting the paths.

 

btrfs subvolume create /mnt/cache/VMs

 

You can use any name you want for the subvolume, I use one for all my VMs.

 

The subvolume will look like a normal folder, so if it's a new VM create a new folder inside the subvolume with the vdisk (e.g: /mnt/cache/VMs/Win10/vdisk1.img), you can also move an existing vdisk there and edit the VM template.

 

Now you can create a snapshot at any time (including with the VM running, but although this works it's probably not recommended since the backup will be in a crash consistent state), to do that use:

 

btrfs subvolume snapshot /mnt/cache/VMs /mnt/cache/VMs_backup

 

If at any time you wanted to go back to an earlier snapshot, stop the VM, and move the snapshot or edit the VM and change the vdisk location to a snapshot.

 

To replace the vdisk with a snapshot:

 

mv /mnt/cache/VMs_backup/Win10/vdisk1.img /mnt/cache/VMs/Win10/vdisk1.img

 

or edit the VM and change vdisk path to confirm this is the one you want before moving it:

 

e.g., change from /mnt/cache/VMs/Win10/vdisk1.img to /mnt/cache/VMs_backup/Win10/vdisk1.img

 

Boot the VM, confirm this is the snapshot you want, shutdown and move it to the original location using the mv command above.

 

 

 

 

Using btrfs send/receive to make incremental backups:

 

Snapshots are very nice but they are not really a backup, because if there's a problem with the device (or even serious filesystem corruption) you'll lose your VMs and snapshots, using btrfs send/receive you can make very fast copies (except for the initial one) of you snapshots to another btrfs device (it can be an array device or an unassigned device).

 

Send/receive only works with read only snapshots, so they need to be created with -r option, e.g.:

 

btrfs subvolume snapshot -r /mnt/cache/VMs /mnt/cache/VMs_backup

 

Run sync to ensure that the snapshot has been written to disk:

 

sync

 

Now you can use send/receive to make a backup of the initial snapshot:

 

btrfs send /source/path | btrfs receive /destination/path

 

e.g.:

 

btrfs send /mnt/cache/VMs_backup | btrfs receive /mnt/disk1

 

no need to create destination subvolume, it will be automatically created.

 

Now for the incremental backups, say it's been some time since the initial snapshot so you'll do a new one:

 

btrfs subvolume snapshot -r /mnt/cache/VMs /mnt/cache/VMs_backup_01-Jan-2017

 

Run sync to ensure that the snapshot has been written to disk:

 

sync

 

Now we'll use both the initial and current snapshots for btrfs to send only the new data to the destination:

 

btrfs send -p /mnt/cache/VMs_backup /mnt/cache/VMs_backup_01-Jan-2017 | btrfs receive /mnt/disk1

 

A VMs_backup_01-Jan-2017 will be created on the destination but much faster than the initial copy, e.g., my incremental backup of 8 VMs took less than a minute.

 

 

 

 

A few extra observations:

 

To list all subvolumes/snapshots use:

 

btrfs subvolume list /mnt/cache

 

You can also delete older unneeded volumes/snapshots, e.g:

 

btrfs subvolume delete /mnt/cache/VMs_backup

 

To change a snapshot from read only to read/write use btrfs property, e.g.:

 

btrfs property set /mnt/cache/VMs_backup_01012017 ro false

 

 

A snapshot only uses the space required for the changes made to a subvolume, so you can have a 30GB vdisk and 10 snapshots using only a few MB of space if your vdisk is mostly static.

  • Upvote 1

Share this post


Link to post
Share on other sites
Posted (edited)

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 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, 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) Shut down the VM, edit the VM XML, and add the virtio-scsi controller below the last existing controller:

 

<controller type='scsi' index='0' model='virtio-scsi'>
</controller>

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 XML again, this time to change the vdisk to use the new controller:

 

Change from:

 

Quote

    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/cache/domains/Windows 10_2/vdisk1.img'/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>

 

To:

 

Quote

    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback' discard='unmap'/>
      <source file='/mnt/cache/domains/Windows 10_2/vdisk1.img'/>
      <target dev='hdc' bus='scsi'/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>

 

4) Start the VM, it's normal for the 1st boot to crash due to Windows fast start, let it reboot and it should start normally after that.

 

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.

 

Edited by johnnie.black
  • Upvote 3

Share this post


Link to post
Share on other sites
On 11/4/2016 at 5:48 PM, RobJ said:

This thread is reserved for Frequently Asked Questions, concerning everything that's VM related on unRAID, their setup, operation, management, and troubleshooting.  Please do not ask for support here, such requests and anything off-topic will be deleted or moved, probably to the VM FAQ feedback topic.  If you wish to comment on the current FAQ posts, or have suggestions or requests for the FAQ, please put them in the VM FAQ feedback topic.  Thank you!

 

Note: there are lots of graphics, allow your browser extra time!  Each page may jump around some as it loads.

 


 

Getting Started

 

 

General Questions

 

 

Maintenance and Troubleshooting

 

 


 

unRAID FAQ's and Guides -

* Guides and Videos - comprehensive collection of all unRAID guides (please let us know if you find one that's missing)

* FAQ for unRAID v6 on the forums, general NAS questions, not for Dockers or VM's

* FAQ for unRAID v6 on the unRAID wiki - it has a tremendous amount of information, questions and answers about unRAID.  It's being updated for v6, but much is still only for v4 and v5.

* Docker FAQ - concerning all things Docker, their setup, operation, management, and troubleshooting

* FAQ for binhex Docker containers - some of the questions and answers are of general interest, not just for binhex containers

* VM FAQ - a FAQ for VM's and all virtualization issues

 

Know of a question that ought to be here?  Please suggest it in the VM FAQ feedback topic.

 

-------------------------------------------------------

Suggested format for FAQ entries - clearly shape the issue as a question or as a statement of the problem to solve, then fully answer it below, including any appropriate links to related info or videos.  Optionally, set the subject heading to be appropriate, perhaps the question itself.

 

While a moderator could cut and paste a FAQ entry here, only another moderator could edit it.  It's best therefore if only knowledgeable and experienced users create the FAQ posts, so they can be the ones to edit it later, as needed.  Later, the author may want to add new info to the post, or add links to new and helpful info.  And the post may need to be modified if a new unRAID release changes the behavior being discussed.

 

Moderators:  please feel free to edit this post.

 

Lazy Saturday Morning.  Updated all the links in the TOC since none of them were working...

  • Upvote 1

Share this post


Link to post
Share on other sites
On 11/9/2016 at 0:50 PM, gridrunner said:

I dont have onboard graphics. Can I pass-through my GPU in the primary slot 1?

 

Yes you can pass-through a GPU in your primary slot when you dont have onboard graphics. Nvidia cards need to have the rom file

passed through to the VM for this to work.

 

How does it work for AMD Cards? Mine goes blank, not even a BIOS screen.....

Share this post


Link to post
Share on other sites
How does it work for AMD Cards? Mine goes blank, not even a BIOS screen.....


Have you tried seabios?

Sent from my ONEPLUS A3000 using Tapatalk

Share this post


Link to post
Share on other sites
On 4/29/2017 at 0:03 PM, 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 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, 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) Shut down the VM, edit the VM XML, and add the virtio-scsi controller below the last existing controller:

 


<controller type='scsi' index='0' model='virtio-scsi'>
</controller>

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 XML again, this time to change the vdisk to use the new controller:

 

Change from:

 

 

To:

 

 

4) Start the VM, it's normal for the 1st boot to crash due to Windows fast start, let it reboot and it should start normally after that.

 

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.

 

Great tip - thanks.

 

Once complete, do the drives need optimising on a schedule?

 

Share this post


Link to post
Share on other sites
18 minutes ago, DZMM said:

Great tip - thanks.

 

Once complete, do the drives need optimising on a schedule?

 

 

No, any deleted blocks should be freed immediately.

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Copyright © 2005-2017 Lime Technology, Inc. unRAID® is a registered trademark of Lime Technology, Inc.