a simple way to passthrough an internal SATA DVD burner [solved]

maxprox

Renowned Member
Aug 23, 2011
420
53
93
Germany - Nordhessen
fair-comp.de
Hi,
I'm looking for an easy and simple way to passthrough an internal SATA DVD burner.
For a medical longtime Archiv, called CGM Praxisarchiv, based on StarBurn 15.1,
Every six weeks, we have to burn two M-DISC under a Win-Server VM.
Is the easiest way to go with an external USB 2.0 DVD burner like the LG GP57EB40 Super Multi?
(and the USB passthrough?)
Or is similar with an internel SATA burner?
If yes, how can I do it?

EDIT:
does this howto http://c-nergy.be/blog/?p=1437 still worked with Proxmox 5.2?
and does he means a SATA DVD burner?


regards,
maxprox
 
Last edited:
Hi,

generall this approach should work because it has nothing do do with PVE ;-)
But you have to use lio instead of scst, because there are no packages anymore in Debian.
 
our howto passthrough a sata dvd burner under Proxmox 5.2:
first, the info:
" you have to use lio instead of scst, because there are no packages anymore in Debian."
does not help us a lot, only we know, that we does not have to install the scst packages...

But we found here a helpfull Thread:
proxmox-5-1-wiki-passthrough-tape-iscsi-solved.38321

according to these instructions, we have:

# installed this packages:
Code:
 apt install tgt open-iscsi lsscsi

# do not forget to enable the services:
Code:
systemctl start tgt.service
systemctl enable tgt.service
systemctl start open-iscsi.service
systemctl enable open-iscsi.service

# to display the new /dev/sgN devices, request devices:
Code:
root@testprox:~# lsscsi -g
[0:0:0:0]    disk    ATA      WDC WD2003FYYS-0 1D01  /dev/sda   /dev/sg0
[1:0:0:0]    disk    ATA      WDC WD2003FYYS-0 1D01  /dev/sdb   /dev/sg1
[2:0:0:0]    disk    ATA      WDC WD2003FYYS-0 1D01  /dev/sdc   /dev/sg2
[4:0:0:0]    cd/dvd  HL-DT-ST DVD-RAM GH24NSD1 LG01  /dev/sr0   /dev/sg3
[5:0:0:0]    disk    ATA      WDC WD2003FYYS-0 1D01  /dev/sdd   /dev/sg4

#the 4:0:0:0 - /dev/sg3 is our built-in Burner:
Code:
root@testprox:~# dmesg | grep CD
[    1.579176] scsi 4:0:0:0: CD-ROM HL-DT-ST DVDRAM GH24NSD1 LG00 PQ: 0 ANSI: 5
[    1.654210] cdrom: Uniform CD-ROM driver Revision: 3.20
[    1.654321] sr 4:0:0:0: Attached scsi CD-ROM sr0
[    2.468476] sr 4:0:0:0: [sr0] tag#12 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
root@testprox:~# dmesg | grep DVD
[    1.518149] ata5.00: ATAPI: HL-DT-ST DVDRAM GH24NSD1, LG00, max UDMA/133
[    1.579176] scsi 4:0:0:0: CD-ROM HL-DT-ST DVDRAM GH24NSD1  LG00 PQ: 0 ANSI: 5

# just as Mario Hosse describes, we have implemented the next 1:1:
Code:
cat /etc/iscsi/initiatorname.iscsi
## for each iSCSI initiator.  Do NOT duplicate iSCSI InitiatorNames.
InitiatorName=iqn.1993-08.org.debian:01:f2f87463ad4

# create target, luns, bind on ip/subnet and save:
Code:
tgtadm --lld iscsi --op new --mode target --tid 1 --targetname iqn.1993-08.org.debian:burner
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 2 --bstype=sg --device-type=pt -b /dev/sg3
tgtadm --lld iscsi --mode target --op bind --tid 1 -I 192.168.2.0/24
tgt-admin --dump > /etc/tgt/targets.conf

# important edit /etc/tgt/targets.conf:
Code:
vim /etc/tgt/targets.conf
# add the following two lines:
device-type pt
bs-type sg
## EDIT, 2021-04-02: and change: "initiator-name" to "initiator-address" see the example

# example targets.conf:
Code:
root@testprox:~# cat /etc/tgt/targets.conf
default-driver iscsi
<target iqn.1993-08.org.debian:brenner>
        device-type pt
        bs-type sg
        backing-store /dev/sg3
        initiator-address 192.168.2.0/24
</target>

# and restart the tgt.service:
Code:
systemctl restart tgt.service

the procedures to initiate the new iSCSI Device for a Windows 2012 R2 Server VM is as described here, there is no difference between a SATA burner or a tape drive:
Using_iSCSI_target_with_Windows_2012_R2

After this initialization I was able to test successfully with two burning programs, starburn (important for my solution) and with cdburnerxp...

many thanks to Mario Hosse,
regards,
maxprox
 
Last edited:
I followed this process (one note, my targets.conf had "initiator-name" and not "initiator-address" which took me about 2 hours to notice. iSCSI could not find the target until i changed it to "address")
So the target is discovered but when i try to connect i get an error:

"The target name is not found or is marked as hidden from login"

any suggestions

UPDATE:

Nevermind! my server name was not exact in the iqn target.
 
Last edited:
  • Like
Reactions: fragpic
For anyone who's looking for a working solution, this tutorial is still working perfectly.
Do remember to change the initiator-name to initiator-address
 
Last edited:
  • Like
Reactions: nullswitch
Hi all, I'm a bit of a novice (still in school). I'm a bit confused on this step:
# create target, luns, bind on ip/subnet and save:
Code:
tgtadm --lld iscsi --op new --mode target --tid 1 --targetname iqn.1993-08.org.debian:burner
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 2 --bstype=sg --device-type=pt -b /dev/sg3
tgtadm --lld iscsi --mode target --op bind --tid 1 -I 192.168.2.0/24
tgt-admin --dump > /etc/tgt/targets.conf

a couple of questions:
- how do i select a valid TID and LUN number?
- do i replace "192.168.2.0/24" with proxmox VE's local IP, or the IP of the destination VM?
- is there a way to do it without involving an IP? The machine's local IP changes sometimes (due to moving my machine)
- if i cant avoid using the IP, how can i edit the IP to the correct one in the future?

Thank you for your help!
 
Just bumping this thread to report success with the instructions found above (post #4 by @maxprox on 2018-10-08).

To be clear about how things are connected and being used in this scenario:

I'm currently running Proxmox 7.1 (Linux 5.13.19-2-pve #1 SMP PVE 5.13.19-4 (Mon, 29 Nov 2021 12:10:09 +0100)) and I was able to expose a SATA Blu-Ray drive installed on my Proxmox host so that other machines on my network can access it via iSCSI... and this is the first time I've ever touched iSCSI.
 
Hi all, I'm a bit of a novice (still in school). I'm a bit confused on this step:


a couple of questions:
- how do i select a valid TID and LUN number?
- do i replace "192.168.2.0/24" with proxmox VE's local IP, or the IP of the destination VM?
- is there a way to do it without involving an IP? The machine's local IP changes sometimes (due to moving my machine)
- if i cant avoid using the IP, how can i edit the IP to the correct one in the future?

Thank you for your help!
I'm afraid I can't help with the TID and LUN; I used the exact text that appears in this thread and it worked for me.

As to the IP address, I believe this should be the CIDR of the network that should have access to the iSCSI device. So for example, if your DHCP server hands out `192.168.42.x` addresses, you should configure it with `192.168.42.0/24`.
 
Hi, this is my fist post, my english is not very good and I'm noob in proxmox and Linux.... after this presentation I hope somebody can help me with a little big problem.
I have seen this post if for sharing a dvd unit through iscsi but I just want to do a single passthrou to a VM with Windows 10. Actually, I got the passthrough but I simply can not write a DVD disk, I can give it format... any thing. I can read a disk but not write. I tryied to change permissions in /dev/sr0 to 777 but I doesn't work, too siple for linux a guess.... Any suggestion, please??? TNX!
 
Hi educruiser,

have a look at my last post: "now I more often work with external USB DVD-Burner (it's more easy ;-)"
With a USB DVD-RW drive you can do it with two klicks in the Proxmox WebGUI
And work with a burning Tool like CDBurnerXP where you have a better overview on the existing DVD drives and it's (RW-) features ...

regards,
maxprox
 
Last edited:
  • Like
Reactions: leesteken
Thank you, I did that yet... but the cd is not recognized. It doesn't appear anywhere. I mean, the driver (f: in windows) is there but cann't write on disks, and I tried to read again but it didn't work either... so... I can not read/write a cd/dvd...
 
HI,

I would work on the proxmox command line:
your DVD-RW drive is attached to an enabled USB port on the proxmox server and is provided with enough power ;-)
first: what USB Drive <=> USB DVD-RW device? You can get it with the lsusb command:
Code:
lsusb
....
Bus 001 Device 002: ID 0e8d:1887 MediaTek Inc.
....

this for example is my DVD-RW one.
do you get such a line, where you found your DVD-RW?
Is such a line in your VMID*1.conf
(*1 Virtual Machine ID, you can get the VMID with ''qm list'')

you can look for this line with
Code:
qm config VMID
or
Code:
cat /etc/pve/qemu-server/VMID.conf
If you do not have the correct line in this config, make it on the command line:

the syntax of this ine in the VMID.config has to be like this:

Code:
...
usb0: host=0e8d:1887
...

As you can see, you only need the short ID from your device.
With the text editor nano you can write it in this file, for example:
Code:
nano /etc/pve/qemu-server/VMID.conf
add a line like this:
...
usb0: host=0e8d:1887
...
with strg + o for saving and strg + x for closing nano.
you have to shutdown the VM
and make a cold new start (not a reboot).
 
Last edited:
Thanks for your efforce. just a question, my dvd-drive is connected on motherboard through a sataIII port, not by usb. I forgot to mention it before.
 
Thanks for your efforce. just a question, my dvd-drive is connected on motherboard through a sataIII port, not by usb. I forgot to mention it before.
With normal drive passthrough you can use data discs with regular files on them but not audio, DVD or Blu-ray video and you cannot (re)write/burn discs. There are several old post on this forum about this, but I have a difficult time finding them.

You can buy a USB to SATA converter and use USB passthrough (as described by @maxprox),
or use PCI passthrough to give the whole SATA controller (and all drives) to the VM (if the SATA controller and your motherboard&CPU support that),
or buy a M.2 to SATA converter and use a M.2 slot that supports PCIe passthrough (if your motherboard&CPU supports that),
or setup iSCSI (over the virtual network) between the Proxmox host and the VM (but I could not get that to work reliably myself).
 
With normal drive passthrough you can use data discs with regular files on them but not audio, DVD or Blu-ray video and you cannot (re)write/burn discs. There are several old post on this forum about this, but I have a difficult time finding them.

You can buy a USB to SATA converter and use USB passthrough (as described by @maxprox),
or use PCI passthrough to give the whole SATA controller (and all drives) to the VM (if the SATA controller and your motherboard&CPU support that),
or buy a M.2 to SATA converter and use a M.2 slot that supports PCIe passthrough (if your motherboard&CPU supports that),
or setup iSCSI (over the virtual network) between the Proxmox host and the VM (but I could not get that to work reliably myself).
I understand. So it is not so easy. I'll keep checkin it out.
 
our howto passthrough a sata dvd burner under Proxmox 5.2:
first, the info:

does not help us a lot, only we know, that we does not have to install the scst packages...

But we found here a helpfull Thread:
proxmox-5-1-wiki-passthrough-tape-iscsi-solved.38321

according to these instructions, we have:

# installed this packages:
Code:
 apt install tgt open-iscsi lsscsi

# do not forget to enable the services:
Code:
systemctl start tgt.service
systemctl enable tgt.service
systemctl start open-iscsi.service
systemctl enable open-iscsi.service

# to display the new /dev/sgN devices, request devices:
Code:
root@testprox:~# lsscsi -g
[0:0:0:0]    disk    ATA      WDC WD2003FYYS-0 1D01  /dev/sda   /dev/sg0
[1:0:0:0]    disk    ATA      WDC WD2003FYYS-0 1D01  /dev/sdb   /dev/sg1
[2:0:0:0]    disk    ATA      WDC WD2003FYYS-0 1D01  /dev/sdc   /dev/sg2
[4:0:0:0]    cd/dvd  HL-DT-ST DVD-RAM GH24NSD1 LG01  /dev/sr0   /dev/sg3
[5:0:0:0]    disk    ATA      WDC WD2003FYYS-0 1D01  /dev/sdd   /dev/sg4

#the 4:0:0:0 - /dev/sg3 is our built-in Burner:
Code:
root@testprox:~# dmesg | grep CD
[    1.579176] scsi 4:0:0:0: CD-ROM HL-DT-ST DVDRAM GH24NSD1 LG00 PQ: 0 ANSI: 5
[    1.654210] cdrom: Uniform CD-ROM driver Revision: 3.20
[    1.654321] sr 4:0:0:0: Attached scsi CD-ROM sr0
[    2.468476] sr 4:0:0:0: [sr0] tag#12 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
root@testprox:~# dmesg | grep DVD
[    1.518149] ata5.00: ATAPI: HL-DT-ST DVDRAM GH24NSD1, LG00, max UDMA/133
[    1.579176] scsi 4:0:0:0: CD-ROM HL-DT-ST DVDRAM GH24NSD1  LG00 PQ: 0 ANSI: 5

# just as Mario Hosse describes, we have implemented the next 1:1:
Code:
cat /etc/iscsi/initiatorname.iscsi
## for each iSCSI initiator.  Do NOT duplicate iSCSI InitiatorNames.
InitiatorName=iqn.1993-08.org.debian:01:f2f87463ad4

# create target, luns, bind on ip/subnet and save:
Code:
tgtadm --lld iscsi --op new --mode target --tid 1 --targetname iqn.1993-08.org.debian:burner
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 2 --bstype=sg --device-type=pt -b /dev/sg3
tgtadm --lld iscsi --mode target --op bind --tid 1 -I 192.168.2.0/24
tgt-admin --dump > /etc/tgt/targets.conf

# important edit /etc/tgt/targets.conf:
Code:
vim /etc/tgt/targets.conf
# add the following two lines:
device-type pt
bs-type sg
## EDIT, 2021-04-02: and change: "initiator-name" to "initiator-address" see the example

# example targets.conf:
Code:
root@testprox:~# cat /etc/tgt/targets.conf
default-driver iscsi
<target iqn.1993-08.org.debian:brenner>
        device-type pt
        bs-type sg
        backing-store /dev/sg3
        initiator-address 192.168.2.0/24
</target>

# and restart the tgt.service:
Code:
systemctl restart tgt.service

the procedures to initiate the new iSCSI Device for a Windows 2012 R2 Server VM is as described here, there is no difference between a SATA burner or a tape drive:
Using_iSCSI_target_with_Windows_2012_R2

After this initialization I was able to test successfully with two burning programs, starburn (important for my solution) and with cdburnerxp...

many thanks to Mario Hosse,
regards,
maxprox
Hi, unfortunately it's not working for me. First I am wondering why to install and run open-iscsi on the SCSI target server? Isn't open-iscsi the software for the initiator to connect to the target which is provided by the tgt.service? Is the initiator-address the ip of the machine which wants to connect to the Target? Do I need this binding? Can I not just remove that line to make it accessible from any machine?

I am trying to connect from a macOS VM with DAEMON Tool to an LTO tape drive. The target server shows up but the target doesn't show up.

I made some tests with the SCST project and the target would show up and I could connect to the tape drive but I had some write issues with it. Therefore I was hoping to have more success with the above provided solution.

How can I troubleshoot that setup? Maybe I just have to tweak some settings.

Thank you.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!