Help Setting Up Ubuntu Server To Run TVheadend


Recommended Posts

OK, so tried it on a Ubuntu Server setup

 

Following the instructions I've already posted...

 

My Ubuntu server setup in KVM

LONAGoQ.jpg

 

Pasting in

    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
      </source>
    </hostdev>

 

Which the KVM plugin turns to (allocating a PCI domain on the ubuntu VM)

 

    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </hostdev>

 

Then I installed the ubuntu iso & booted.

Ran

lspci -knn

 

And saw

26L6ex9.jpg

 

Note the address now matches

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

 

Rather than

02:00.0 Multimedia controller [0480]: Philips Semiconductors SAA7160 [1131:7160] (rev 02)

        Subsystem: Device [6285:0001]

which was the address on the Unraid host OS.

 

Here's my complete XML file for reference

<domain type='kvm'>
  <name>TVHeadEnd</name>
  <uuid>52c64f2e-ffcd-14e4-0876-824e00c83f65</uuid>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <memoryBacking>
    <nosharepages/>
    <locked/>
  </memoryBacking>
  <vcpu placement='static'>1</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.2'>hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='1' threads='1'/>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source file='/mnt/disk/KVM/VM/TVHeadEnd/vdisk1.img'/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/disk/KVM/Media/ubuntu-14.10-server-amd64.iso'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/mnt/cache/Recorded TV/'/>
      <target dir='recordings'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </filesystem>
    <interface type='bridge'>
      <mac address='52:54:00:4a:ad:2c'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0' keymap='en-gb'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='vmvga' vram='16384' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

So it's definitely possible.  Give it another go following this guide and see what happens.

 

One other thing, why don't you post us a screenshot/photo of your BIOS setup so we can check that looks good.

 

Link to comment
  • Replies 82
  • Created
  • Last Reply

Top Posters In This Topic

Thanks again.

 

Here's my xml:

 

<domain type='kvm'>

  <name>Ubuntu</name>

  <uuid>afc90933-cf0c-2277-3751-2611785f5527</uuid>

  <memory unit='KiB'>3145728</memory>

  <currentMemory unit='KiB'>3145728</currentMemory>

  <memoryBacking>

    <nosharepages/>

    <locked/>

  </memoryBacking>

  <vcpu placement='static'>1</vcpu>

  <cputune>

    <vcpupin vcpu='0' cpuset='0'/>

  </cputune>

  <os>

    <type arch='x86_64' machine='pc-i440fx-2.2'>hvm</type>

  </os>

  <features>

    <acpi/>

    <apic/>

  </features>

  <cpu mode='host-passthrough'>

    <topology sockets='1' cores='1' threads='1'/>

  </cpu>

  <clock offset='utc'>

    <timer name='rtc' tickpolicy='catchup'/>

    <timer name='pit' tickpolicy='delay'/>

    <timer name='hpet' present='no'/>

  </clock>

  <on_poweroff>destroy</on_poweroff>

  <on_reboot>restart</on_reboot>

  <on_crash>restart</on_crash>

  <devices>

    <emulator>/usr/bin/qemu-system-x86_64</emulator>

    <disk type='file' device='disk'>

      <driver name='qemu' type='raw' cache='none' io='native'/>

      <source file='/mnt/cache/KVM/VM/Ubuntu/vdisk1.img'/>

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

      <boot order='1'/>

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

    </disk>

    <disk type='file' device='cdrom'>

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

      <source file='/mnt/user/KVM/Media/ubuntu-14.04.2-server-i386.iso'/>

      <target dev='hda' bus='ide'/>

      <readonly/>

      <boot order='2'/>

      <address type='drive' controller='0' bus='0' target='0' unit='0'/>

    </disk>

    <controller type='usb' index='0'>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>

    </controller>

    <controller type='pci' index='0' model='pci-root'/>

    <controller type='ide' index='0'>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>

    </controller>

    <filesystem type='mount' accessmode='passthrough'>

      <source dir='/mnt/user/RecordedTV/'/>

      <target dir='Recorded TV'/>

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

    </filesystem>

    <interface type='bridge'>

      <mac address='52:54:00:a3:0d:50'/>

      <source bridge='Bridge'/>

      <model type='virtio'/>

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

    </interface>

    <serial type='pty'>

      <target port='0'/>

    </serial>

    <console type='pty'>

      <target type='serial' port='0'/>

    </console>

    <input type='tablet' bus='usb'/>

    <input type='mouse' bus='ps2'/>

    <input type='keyboard' bus='ps2'/>

    <graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0'>

      <listen type='address' address='0.0.0.0'/>

    </graphics>

    <video>

      <model type='vmvga' vram='16384' heads='1'/>

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

    </video>

    <hostdev mode='subsystem' type='pci' managed='yes'>

      <driver name='vfio'/>

      <source>

        <address domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>

      </source>

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

    </hostdev>

    <memballoon model='virtio'>

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

    </memballoon>

  </devices>

</domain>

 

Link to comment

I'd already downloaded your manual.

 

On page 52 there is an option called VT-d check that this is enabled in your BIOS.

 

Intel Virtualisation technology isn't enough by itself.  I think that is just plain VT-x you need VT-d enabled for passthrough.

Link to comment

I've updated to ASrock newest bios for the motherboard.

 

This is the link for my motherboard manual:

 

ftp://europe.asrock.com/manual/H81%20Pro%20BTC.pdf

 

In the CPU config section I have the "Intel Virtualization Technology" enabled.  Which I thought would be enough to enable the VM.

 

I think thats what you would see from the photo

You have to activate vt-d in the chipset configuration also for passthrough to work.

Link to comment

I've updated to ASrock newest bios for the motherboard.

 

This is the link for my motherboard manual:

 

ftp://europe.asrock.com/manual/H81%20Pro%20BTC.pdf

 

In the CPU config section I have the "Intel Virtualization Technology" enabled.  Which I thought would be enough to enable the VM.

 

I think thats what you would see from the photo

You have to activate vt-d in the chipset configuration also for passthrough to work.

 

I just said that lol  ;D

Link to comment

YES!

 

Got you there in the end, I've got a big smile on my face now! 

 

Don't worry dude, that's what this community is all about, plenty have helped me over the years!

 

If ever you're in Staffordshire let me know and we'll go for a pint.

 

On the plus side I've posted in the sticky on "Easy" PCI passthrough as I think I've written a pretty clear tutorial so hopefully can help others new to KVM in Unraid.

Link to comment

I think I may have been a nugget!

 

Ubuntu now has 1 of the tuners.  Now for the other....

 

Think there is a bottle of wine here with your name on it CHBMB!

 

If you PM me your address< I owe you a drink I think.

 

Thanks again

 

Mark this bad boy - SOLVED and next time RTFM!! LOL  ;D

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.