<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">On 2009-11-09, at 11:46 PM, Gerry Reno wrote:</div></span></div></span></div></span></div></span></span></div><div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Adam Mooz wrote:<br><blockquote type="cite">Hello List,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I'm attempting to pass a DVD drive of a headless server into a virtual machine.  So far I've managed to mount *something* into the VM, but it's being registered as a blank DVD within the VM. When I mount /dev/dvd into the bare-metal machine it registers normally as the DVD.  How do I pass physical drives into a VM and back out using libvirt?  <br></blockquote><blockquote type="cite">Command used:<br></blockquote><blockquote type="cite">#virsh attach-disk Montreal /dev/dvd hdc --mode readonly --driver phy --type cdrom<br></blockquote><blockquote type="cite">Connecting to uri: <a href="qemu:///system">qemu:///system</a><br></blockquote><blockquote type="cite">Disk attached successfully<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">VM XML file:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><domain type='kvm'><br></blockquote><blockquote type="cite">  <name>Montreal</name><br></blockquote><blockquote type="cite">  <uuid>0f79ba7f-27bf-16a0-5887-6cfa2b5569f1</uuid><br></blockquote><blockquote type="cite">  <memory>2097152</memory><br></blockquote><blockquote type="cite">  <currentMemory>2097152</currentMemory><br></blockquote><blockquote type="cite">  <vcpu>1</vcpu><br></blockquote><blockquote type="cite">  <os><br></blockquote><blockquote type="cite">    <type arch='x86_64' machine='pc-0.11'>hvm</type><br></blockquote><blockquote type="cite">    <boot dev='hd'/><br></blockquote><blockquote type="cite">  </os><br></blockquote><blockquote type="cite">  <features><br></blockquote><blockquote type="cite">    <acpi/><br></blockquote><blockquote type="cite">    <apic/><br></blockquote><blockquote type="cite">    <pae/><br></blockquote><blockquote type="cite">  </features><br></blockquote><blockquote type="cite">  <clock offset='utc'/><br></blockquote><blockquote type="cite">  <on_poweroff>destroy</on_poweroff><br></blockquote><blockquote type="cite">  <on_reboot>restart</on_reboot><br></blockquote><blockquote type="cite">  <on_crash>restart</on_crash><br></blockquote><blockquote type="cite">  <devices><br></blockquote><blockquote type="cite">    <emulator>/usr/bin/kvm</emulator><br></blockquote><blockquote type="cite">    <disk type='file' device='cdrom'><br></blockquote><blockquote type="cite">      <target dev='hdc' bus='ide'/><br></blockquote><blockquote type="cite">      <readonly/><br></blockquote><blockquote type="cite">    </disk><br></blockquote><blockquote type="cite">    <disk type='file' device='disk'><br></blockquote><blockquote type="cite">      <source file='(Mangled Purposely)'/><br></blockquote><blockquote type="cite">      <target dev='vda' bus='virtio'/><br></blockquote><blockquote type="cite">    </disk><br></blockquote><blockquote type="cite">    <interface type='bridge'><br></blockquote><blockquote type="cite">      <mac address='(mangled purposly)/>       <source bridge='br0'/><br></blockquote><blockquote type="cite">      <model type='virtio'/><br></blockquote><blockquote type="cite">    </interface><br></blockquote><blockquote type="cite">    <serial type='pty'><br></blockquote><blockquote type="cite">      <target port='0'/><br></blockquote><blockquote type="cite">    </serial><br></blockquote><blockquote type="cite">    <console type='pty'><br></blockquote><blockquote type="cite">      <target port='0'/><br></blockquote><blockquote type="cite">    </console><br></blockquote><blockquote type="cite">    <input type='mouse' bus='ps2'/><br></blockquote><blockquote type="cite">    <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/><br></blockquote><blockquote type="cite">    <video><br></blockquote><blockquote type="cite">      <model type='cirrus' vram='9216' heads='1'/><br></blockquote><blockquote type="cite">    </video><br></blockquote><blockquote type="cite">  </devices><br></blockquote><blockquote type="cite"></domain><br></blockquote><blockquote type="cite"><br></blockquote><br>I haven't done this for a while but I believe you have to issue a 'detach' command afterwards.<br><br>-Gerry<br><br>--<br>Libvir-list mailing list<br><a href="mailto:Libvir-list@redhat.com">Libvir-list@redhat.com</a><br>https://www.redhat.com/mailman/listinfo/libvir-list<br></div></blockquote><br></div><div><div># virsh detach-disk Montreal hdc</div><div>Connecting to uri: <a href="qemu:///system">qemu:///system</a></div><div><div>error: this function is not supported by the hypervisor: only SCSI or virtio disk device can be detached dynamically</div><div><br></div><div>? Also, I'm not sure if you understood my question.  When I pass in the DVD device into the VM it registers as a blank DVD.  if I pass in a non-existant folder it blows up, so I know it's reading something from the real DVD drive.  Mounting the real DVD drive in the bare-metal machine shows the files on the drive, but I cannot get them to appear in the VM.  How do I get the same files to show up in the VM (i.e. mount the DVD drive into the VM)?</div><div><br></div></div></div><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">-----------------------------------------------------------------</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><b><font class="Apple-style-span" color="#8C000E">Adam Mooz</font></b><br><font class="Apple-style-span" color="#929292"><i><a href="mailto:Adam.Mooz@gmail.com">Adam.Mooz@gmail.com</a><br></i><i><a href="mailto:AdamMooz@me.com">AdamMooz@me.com</a></i></font><font class="Apple-style-span" color="#929292"><i><br></i></font><font class="Apple-style-span" color="#929292"><a href="http://www.AdamMooz.com">http://www.AdamMooz.com</a></font></div></div><br></body></html>