[SOLVED] How To create a D-drv accessible from both inside & outside a W8/10 VM


Recommended Posts

Hi,

I've scanned the Wiki and the forum for an answer to my issue, but I couldn't find anything so could someone please give me a steer ...

 

I have Windows 10 running in a VM on v6.1.3 pro, hosting a CCTV app - BlueIris which is only available for Windows unfortunately.

 

It all works fine, but I'd like to be able to create a D: drive (the drive letter is unimportant) to access from the VM, so that I can write the CCTV alerts, clips and logs to it, rather than having them stored within the W10 VM's C: drive. I also need to access these files from outside the VM, so I can view them from another device running BlueIris.

 

I can see the ISO and drivers appear as CD 'drives' in the 'This PC' devices list.

I realise I could create a network drive and map it, but this is not loaded until after the windows service starts, so the BI service is not working correctly.

 

If I create another vdisk, it appears alongside the VM summary as a drive with the volume I set for it added to the total space available to the VM, but I can't see it as a separate drive in my 'This PC' list.

 

Is it expected that I split the VM's vdisk into multiple volumes or something ?

Even if I did, the data would still be on the same vdisk and therefore not accessible from outside

 

What am I missing or .. any alternative suggestions on how I can create a D-drive and make it available to my W10 VM ?

Link to comment

OK thanks for those suggestions, but here's my obs so far:

I don't think a network share is available when a windows service loads. I have these already configured (hosted on fast SSD's) and it isn't working.

I've also tried mounting a drive (an SSD) outside the array (via unassigned plugin)  .. but I can't see it from within the VM. How to configure this so that the VM can address it?

Someone suggested passing through a whole disk. That's fine .. BUT HOW ???. I have a few small SSD's I can experiment with .. but can someone please explain how to do this. I can't see an option within the VM config page to dedicate a storage device, whereas if I wanted to give it a USB device or a sound card - there are already options listed/built-in.

 

So .. How To .. dedicate a separate drive/disk/dev to a VM ?

Link to comment

Yes you can add a disk to your vm either whole disk or just a partition. I have a mythbuntu vm with a 2.5" 750GB drive added for tv recording and live tv buffer. I added the whole disk. By doing this I could manipulate partitions. I created a partition and formatted it to jfs. You should be able to mount your ntfs partitioned drives.

<disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source dev='/dev/disk/by-id/ata-WDC_WD7500BPKX-00HPJT0_WD-WXL1E84AK1MK'/>
      <target dev='hdd' bus='virtio'/>
    </disk>

 

http://lime-technology.com/forum/index.php?topic=48340.msg464389#msg464389

Link to comment

 

 

 

I've also tried mounting a drive (an SSD) outside the array (via unassigned plugin)  .. but I can't see it from within the VM. How to configure this so that the VM can address it?

 

 

If you share it [the drive] via the plugin than you have to see it when you browse \\tower. Then you can map it or simply use the link in Blueiris.

 

Sent from my SM-G920F using Tapatalk

 

 

Link to comment

When you share the disk via the unassigned plugin it will become a share named what the name of the disk is.

for example when i share a disk it is share name ST3500312CS_9VVERKB1 (this is the name of my disk yours will be different). The drive must also be formatted.

You should then be able to see it under \\tower\ST3500312CS_9VVERKB1

then from windows you will need to map a shared drive to it.  ie X drive. once you have mapped a drive letter to the share then set the location in blue iris to the drive letter of the mapped share  ie X if you are not sure how to map a drive check here http://windows.microsoft.com/en-gb/windows/create-shortcut-map-network-drive#1TC=windows-7

 

 

 

 

 

Link to comment

OK - thanks for those suggestions and links everyone. I got it working .. but not before hitting a few unexpected issues.

It would be really helpful to have this properly documented in the Wiki though - by someone who really knows what they're doing.

 

So I pasted the XML syntax suggested after the primary vdisk section (I decide to use the KISS principle and not use a named device at this stage):

 

<disk type='block' device='disk'>

      <driver name='qemu' type='raw' cache='writeback'/>

      <source dev='/dev/sdq'/>

      <target dev='hdd' bus='virtio'/>

      </disk>

 

Where my disk (installed via unassigned devices) happens to be /dev/sdq (this disk happens to be an SSD)

 

Afterwards, this entry appears in the VM config page as:

 

'2nd vDisk Location'        /dev/sdq      ... that's it, nothing else

 

However, I still couldn't see it as a drive or access it. Initially it was an XFS vol - Windows didn't have a clue. I tried re-formatting it as Fat32, then xfat and a few others, but although I could see the volume using 'diskmgmt.msc' I couldn't read or write to it ... until... I deleted the partition from within the VM, re-formatted it to NTFS and mapped it to a drive from with the VM.

 

Tried stop/starting the VM, and it was still there.

 

Checked the XML for changes - a bit more code had been added to the section (Address type....), viz:

 

<disk type='block' device='disk'>

      <driver name='qemu' type='raw' cache='writeback'/>

      <source dev='/dev/sdq'/>

      <target dev='hdd' bus='virtio'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>

    </disk>

 

Not sure what if anything this bit of code does.

 

So OK I can now write to a separate drive from the VM, but here are my follow up questions/issues:

 

1. Could I have got the same result by adding '/dev/sd#' to the 'add a vdisk line' ?

2. How/is it possible to specify the drive letter from within the XML for each device. I want my extra drive to be D: not F: or G:

3. How can I now access the Drive I've added, but from outside the VM as well ? This was one of my key objectives and I still can't do it.

4. If I add a vol as a network share to my unRAID and map it to a drive from within the VM .. would this work better. The problem with this may be the time it takes to re-instate the mapping might be too slow for using with my app running as a service.

 

I'll try a couple of these myself if I can find another spare SSD.

 

Any more thoughts/suggestions on this anyone

Thanks.

 

Link to comment

I would switch to the device by id instead of /dev/sdX. The sdX can change when unRAID is rebooted.

 

The drive letter can be changed in Windows though the Computer Management Disk Drive section.

 

To access the drive outside the vm you have to create a network share in Windows.

Link to comment

@dmacias - Thanks for the advice. Incidentally I'd always intended to do this eventually, but what I didn't anticpate is that when I added another SSD (thanks to Amazon prime for next day delivery) to my unassigned disks, the new disk took the 'sdq' assignment, so I needed to do something.

So I changed the XML to point to the device 'by-ID' instead.

Note that you'll need to check the exact label given to the disk device first (guessing it didn't work) -

Use a console or telnet/PUTTY to login at root:

 

cd /dev/disk/by-id

 

root@<Servername>:/dev/disk/by-id# ls

 

ata-CT240BX200SSD1_1616F01A9BE8@

ata-M4-CT064M4SSD2_000000001319093AC540@

ata-M4-CT064M4SSD2_000000001319093AC540-part1@

ata-Samsung_SSD_840_PRO_Series_S12RNEAD348814F@

ata-Samsung_SSD_840_PRO_Series_S12RNEAD348814F-part1@

ata-Samsung_SSD_840_PRO_Series_S1ATNSAF535778E@

ata-Samsung_SSD_840_PRO_Series_S1ATNSAF535778E-part1@

ata-Samsung_SSD_850_PRO_256GB_S251NWAG208675V@

ata-Samsung_SSD_850_PRO_256GB_S251NWAG208675V-part1@

ata-Samsung_SSD_850_PRO_512GB_S250NWAG706190L@

ata-Samsung_SSD_850_PRO_512GB_S250NWAG706190L-part1@

ata-WDC_WD10EFRX-68FYTN0_WD-WCC4J5RLZ3NR@

ata-WDC_WD10EFRX-68FYTN0_WD-WCC4J5RLZ3NR-part1@

..etc

 

pick out the relevant device by ID and edit the VM XML :

 

    <disk type='block' device='disk'>

      <driver name='qemu' type='raw' cache='writeback'/>

      <source dev='/dev/disk/by-id/ata-M4-CT064M4SSD2_000000001319093AC540-part1'/>

      <target dev='hdd' bus='virtio'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>

    </disk>

 

Check the entry in the VM header corresponds:

 

2nd vDisk Location        /dev/disk/by-id/ata-M4-CT064M4SSD2_000000001319093AC540-part1

 

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

 

So what next ...

Well, having added a further unassigned (new, un-formatted, SSD) disk I then discover that I can't format it from within the unassigned listing. 'Format' has a button, but it doesn't work.

Not sure why this is.

I could assign it to the array and format it - but then I'd have to remove it - I don't have time for that.

I could have removed it and stuck it on my Linux laptop and used Gparted to format it, but then I realise that I could achieve the same effect by creating a new share on the Cache and mapping it from within the VM as a network drive mapped to G:

So I did all that.

I created the relevant sub-folder for BlueIrisDB

I edited the 'startup' page of BI to enable run as a service.

I edited the BlueIris config page for 'Clips and Archiving' and tried switching this between F: (local) and G: (mapped network drv, but remember that this is an SSD on this same server)

lo and behold - BI works 'as a service' fine BUT ONLY if the BlueIrisDB is on a local drive.

 

I also noticed after a couple of restarts of BI, that the mapped network drive didn't always re-connect. So the issue is obviously as I suspected, the drive needs to be available before the service starts, so this can only be done with a local drive.

 

So for those that suggested mapping a network drive - it doesn't work when running BI as a service.

 

I guess the only way to then share the BI DB (it's not so fussy about the clips and alerts) when running BI 'as a service' will be to SHARE the local drive via the Windows VM.

I'll try that later and report back. 

 

 

Link to comment

once you have passed through the disk to the vm. in windows goto administrator tools, then computer management, then disk management, then here you will see your disk and you can format it, partition drive etc.

You do not need to mount it in unassigned devices as the disk is being passed through to the vm.

If you cant see your disk in the disk management console in windows then you have made an error in your passthrough.

 

Check the main tab in unraid then look at the unassigned devices. here you will see the disk ids of unassigned devices.

For example one of my disks here is id ST31000528AS_6VP41EPS

so to passthrough that disk i just add disk as /dev/disk/by-id/ata-ST31000528AS_6VP41EPS

Link to comment

@gridrunner - thanks for ... 'in windows goto administrator tools, then computer management, then disk management'

 

For other readers benefit, this gets you to the same place as:

Search >Cmd >diskmgmt.msc .. where you can see and format your drives

 

Anyway, I 'Shared' the drive which I'd earlier passed through to the VM, and job done. I can now see the Files which BlueIris is writing from with the VM.

 

So to summarise, the steps needed to share files created within a W10 VM by an application (in my case BlueIris) running as a windows service and therefore needing to access the storage before network shares are available, ie available immediately when windows starts, are :

 

1. Add a disk outside the unRAID array via Unasigned devices. I used an SSD. I haven't tested this with a spinning disk.

2. Login via a console/Putty and check the name of the device 'by-id'

cd /dev/disk/by-id

root@<Servername>:/dev/disk/by-id# ls

eg:

ata-CT240BX200SSD1_1616F01A9BE8@

ata-M4-CT064M4SSD2_000000001319093AC540@

ata-M4-CT064M4SSD2_000000001319093AC540-part1@

...

3. Edit the VM XML and add the device similar to:

    <disk type='block' device='disk'>

      <driver name='qemu' type='raw' cache='writeback'/>

      <source dev='/dev/disk/by-id/ata-M4-CT064M4SSD2_000000001319093AC540-part1'/>

      <target dev='hdd' bus='virtio'/>

   

    </disk>

 

4. Check the entry in the VM header for your new disk corresponds:

2nd vDisk Location        /dev/disk/by-id/ata-M4-CT064M4SSD2_000000001319093AC540-part1

 

5. in windows goto administrator tools, then computer management, then disk management

OR

Search >cmd >diskmgmt.msc ..

Select the new volume and format it as NTFS, mapped to a new drive letter, say F:

 

6. In Windows, right click the volume. Select >Share with >Advanced sharing ... go through the steps to set the relevant sharing parameters you need.

 

7. Start writing files to your F: drive ... and they will be visible on your network from outside your VM via:

\\<YourVMname>\<YourShareName>

 

In my scenario at least, this is now Solved

Thanks everyone for help with this issue.

 

Link to comment

Like gridrunner was saying I would drop the "-part1" and pass through the whole disk instead of partition 1. Unless you have other partitions on the disk for other uses. But if your using the whole disk in Windows, you don't need unassigned devices at all. You pass through the whole disk and you can partition and format how you want in Windows.

Link to comment

Update:

I've now tested this with a spinning disks too, with a W10 VM, configured as a local drive to the VM but also shared out on my network, as a target folder for an app running as a Windows service (although only tested this with) Blue Iris 4..

 

This has now allowed me to use/re-use a WD Purple disk for this data. Purple's are apparently specifically designed for CCTV capture .. and also I suspect this config will result in less hammer on my parity disk.

 

 

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.