LibreELEC/OpenELEC Krypton templates?


Recommended Posts

5 hours ago, hernandito said:

 

Hi,

 

Thanks exist2resit.

 

I am finally back at my desktop and attempting this again. I used your xml and like you, I was able to install LibreELEC. But it will NOT start Xorg once installed. I also do NOT have a graphic card to pass through. I want to use VNC and use this as a Kodi library update VM.

 

This is what I get when it tries to boot:

 

gHPKAbQ.png

 

I tried using all 3 VNC Video drives, Cirrus, QXL and vmvga but none worked.

 

Anyone able to solve this?

 

Thanks,

 

H.

 

 

if you solve this let me know. ive been stuck with same issues for months lol

Link to comment
6 hours ago, Furby8704 said:

 

if you solve this let me know. ive been stuck with same issues for months lol

 

I think I might grab a cheap Video Card for this purpose.

A passively cooled Radeon 5450 only costs about $50 CAD. 

This way I can avoid this problem in the future, and roll out my own LibreELEC VMs.

Although I need to check if I have the room in my case for another PCI card.

Link to comment
Just now, exist2resist said:

Sorry, but that is just not true. 

I'm running the Limetech template for LibreELEC 7.0.1 without any GPU passthrough.

You misread

 

3 minutes ago, Squid said:

If you're not using the Limetech template, then you MUST have a card to passthrough.

 

Link to comment
2 hours ago, exist2resist said:

 

I think I might grab a cheap Video Card for this purpose.

A passively cooled Radeon 5450 only costs about $50 CAD. 

This way I can avoid this problem in the future, and roll out my own LibreELEC VMs.

Although I need to check if I have the room in my case for another PCI card.

 

hmm its only $30 here. will the card work fine??

Link to comment

Same exact goals/issues as hernandito and a few others.

 

I'm looking for a headless-Kodi version as the docker is flakey at best.  I need a simple instance of Kodi to be able to update my libraries, which are now on Krytpon.

 

I too am running a server without a dedicated graphics card which seems to be what's holding me back according to squid.

 

Are there any types of workarounds besides buying a graphics card?  Again, the only need for this instance of Kodi is to run 24/7 and be able to receive notifications to update the library.

 

 

 

 

Edited by Living Legend
Link to comment

I've been futzing around with this for the last few hours.  Stumbled across a github pull request for LibreELEC & virtio-gpu support.

 

I created a bootable disk starting with a libreelec8.0.img and upgraded it using a Milhouse build.  This needed to be done on a bootable USB on a separate x86_64 PC and then brought back to unRAID.  The new VM was created from the modded bootable disk.

 

It's slow and clunky, but from what I can tell so far, should get the job done since I'm not looking to get anything out of the GUI.

 

Here's the pull request:

https://github.com/LibreELEC/LibreELEC.tv/pull/1287

 

It was a bit complicated for a lower level user like myself, but I was able to tinker enough and figure it out.  If anyone has any specific questions, I'll check back and see if I can help.

 

EDIT: Gotta head to sleep, but just realized this is Kodi 18 so it migrated the database!  Geesh.  Thought i had it.  But it seems like either way, it's doable without a GPU

Edited by Living Legend
Link to comment
5 hours ago, Living Legend said:

I've been futzing around with this for the last few hours.  Stumbled across a github pull request for LibreELEC & virtio-gpu support.

 

I created a bootable disk starting with a libreelec8.0.img and upgraded it using a Milhouse build.  This needed to be done on a bootable USB on a separate x86_64 PC and then brought back to unRAID.  The new VM was created from the modded bootable disk.

 

It's slow and clunky, but from what I can tell so far, should get the job done since I'm not looking to get anything out of the GUI.

 

Here's the pull request:

https://github.com/LibreELEC/LibreELEC.tv/pull/1287

 

It was a bit complicated for a lower level user like myself, but I was able to tinker enough and figure it out.  If anyone has any specific questions, I'll check back and see if I can help.

 

EDIT: Gotta head to sleep, but just realized this is Kodi 18 so it migrated the database!  Geesh.  Thought i had it.  But it seems like either way, it's doable without a GPU

 

thanks for this. will be trying it for sure!

 

EDIT:

I was able to create the boot drive just fine.

can you share your xml config for your template??

Edited by Furby8704
Link to comment
<domain type='kvm' id='74'>
  <name>LibreELEC - Kodi</name>
  <uuid>9686bec9-b592-0a98-054e-182d935a2c05</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Linux" icon="linux.png" os="linux"/>
  </metadata>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>1</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-2.5'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/9686bec9-b592-0a98-054e-182d935a2c05_VARS-pure-efi.fd</nvram>
  </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/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/vm/libreelec/vdisk1/vdisk1.img'/>
      <backingStore/>
      <target dev='hdc' bus='sata'/>
      <boot order='1'/>
      <alias name='sata0-0-2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <controller type='usb' index='0' model='nec-xhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <model name='i82801b11-bridge'/>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <model name='pci-bridge'/>
      <target chassisNr='2'/>
      <alias name='pci.2'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:e2:54:f0'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-LibreELEC - Kodi/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5901' autoport='yes' websocket='5700' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='virtio' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </memballoon>
  </devices>
</domain>

For this to work for our purposes, someone will have to apply the changes of this pull request to a Krytpon build.  I'm not too familiar with github, or with compiling from source code, but I guess now would be a good excuse to learn!

Edited by Living Legend
Link to comment

I created a fork of the LibreELEC Repository, and a new branch for what will hopefully be a version of LibreELEC 8.0 that will run as a VM instance without the need of a graphics ca rd

 

https://github.com/cmgraz/LibreELEC.tv

 

I am compiling now on a low resource Ubuntu VM.  It'll probably take a few hours, but I'll report back with the results.  Hopefully I will have good news.

 

Link to comment

Success!

 

a89cab31387e4a948d5f55422426b123.png

 

https://github.com/cmgraz/LibreELEC.tv

 

My VM is a mess now as it's running with limited resources, and I still need to tinker with the hardware acceleration.  I haven't done much besides boot it up, but I was glad to see that I was able to boot into Kodi 17.1 without having a graphics card on my unRAID server.

 

The .img is 561MB.  If someone has a place they'd like me to upload it, let me know.  Below is also the contents of the XML.  Don't forget, the XML is to run the VM after the install from the .img file.  You need to create the primary disk being the IMG file, and then create a secondary disk.  During the install, you will write to the secondary disk.  Once install is complete, you can kill the VM and then copy and paste the XML:

 

<domain type='kvm' id='92'>
  <name>LibreELEC - Krypton</name>
  <uuid>61a64473-a412-dda9-866c-20926be489eb</uuid>
  <description>Krytpon for library updating</description>
  <metadata>
    <vmtemplate xmlns="unraid" name="Linux" icon="linux.png" os="linux"/>
  </metadata>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>1</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-2.5'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/61a64473-a412-dda9-866c-20926be489eb_VARS-pure-efi.fd</nvram>
  </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/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/vm/librekrypton/vdisk.img'/>
      <backingStore/>
      <target dev='hdc' bus='sata'/>
      <boot order='1'/>
      <alias name='sata0-0-2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <controller type='usb' index='0' model='nec-xhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <model name='i82801b11-bridge'/>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <model name='pci-bridge'/>
      <target chassisNr='2'/>
      <alias name='pci.2'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:e2:54:f0'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/2'>
      <source path='/dev/pts/2'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-LibreELEC - Krypton/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5901' autoport='yes' websocket='5700' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='virtio' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </memballoon>
  </devices>
</domain>

My first time compiling source code like this, so I make no guarantees that this will work for you, or that I really know what I am doing.  

 

Let me know how this works out!

Edited by Living Legend
Link to comment

Exciting news... but I am a little lost when it comes to VM's. Dockers I can handle any day.

 

What are the steps in accomplishing what you did? There is an XML, and you said you have an img file. Please, what are the steps to getting this installed.

 

Many thanks.

 

ps. What happens if LibreElec gets updated from v 8.0.0 to 8.0.1? does it go back to not working?

Edited by hernandito
Link to comment
14 hours ago, hernandito said:

Exciting news... but I am a little lost when it comes to VM's. Dockers I can handle any day.

 

What are the steps in accomplishing what you did? There is an XML, and you said you have an img file. Please, what are the steps to getting this installed.

 

Many thanks.

 

ps. What happens if LibreElec gets updated from v 8.0.0 to 8.0.1? does it go back to not working?

 

Here's the rundown:

 

I found tweaks that were made on a nightly build that's actually already running Kodi 18.0.  These tweaks allowed LibreELEC to run in the manner we're looking, no dedicated graphics card on a VM.  Unfortunately, Kodi 18 has migrated to MyVideos108 rather than MyVideos107, so this wouln't help with our library syncing/updating goals.  So what I did was I took the source files from LibreELEC running Kodi 17.1, took the individual changes that were made to allow for us to be able to run without the GPU, compiled, and created what is essentially a new version of LibreELEC 8.0.

 

So yes, the end result of compiling the source code is an .img file which is precisely what we need to create a VM.  This will start out as our primary vdisk location.  Check out the below image to see how to set things up on the unRAID GUI:

 

16d5e7f160b0454bad869d11b38bb4d2.png

 

I believe you could also set the IMG file as the "OS Install ISO" instead, but I've always gone the route shown above.  Probably no difference.

 

After hitting create, you'll get brought back to the unRAID VM GUI.  Click the green triangle and connect via VNC.  At this point, it should look like a standard LibreELEC install.  It will ask you for an install location, and the only option should be the "2nd vDisk Location" which you created above.  Allow it to clear/format and overwrite this disk when performing the install.  When done, it'll says it's time to reboot.  At this point, go back to the VM screen and force kill the VM.  Then tap the red square and go to "EDIT".  Go to the Primary vDisk location and select NONE.  You no longer want the VM to run off of the original .img file.  Now, the secondary vDisk which is what we just installed the OS to will become your main drive.

 

After saving your changes, go back and this time after clicking on the red square, select "EDIT XML":

 

cd2d87f87b0747b4a1eb448873e40313.pngThe XML is the blueprint for the VM, presenting information ranging from resource allocation to peripheral location.  Here's what I would do.  Again, this is guess work fudging, but it's what worked for me.  Find the bracket towards the middle bottom starting with <channel type='unix'> and delete it along with everything below it to the bottom.  Now copy and paste my XML and replace it:

<channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-LibreELEC - Krypton/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5901' autoport='yes' websocket='5700' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='virtio' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </memballoon>
  </devices>
</domain>

The first part of your XML is specific to your setup, referencing resource allocation as well as disk locations.  They second half represents some of the tweaks needed to be made to allow VNC to work.

 

After these changes, save and boot!

 

EDIT: @hernandito to answer your last question about version changing.  If I understand correctly, your goal was about updating libraries, so just make sure that all of your client devices along with this VM stay on Krypton.  They can move from 8.0.0 to 8.0.1 and beyond, as long as it's still on Krypton.  Once you move something off of Krypton and onto Kodi 18, it will be on a different database at which poitn you'll either have to roll it back, or move everything else up.  Fortunately, we also have a working file of Kodi 18 as this is where I got these fixes from, so we should be safeguarded for quite some time.

Edited by Living Legend
  • Upvote 1
Link to comment
15 hours ago, Living Legend said:

I created a fork of the LibreELEC Repository, and a new branch for what will hopefully be a version of LibreELEC 8.0 that will run as a VM instance without the need of a graphics ca rd

 

https://github.com/cmgraz/LibreELEC.tv

 

I am compiling now on a low resource Ubuntu VM.  It'll probably take a few hours, but I'll report back with the results.  Hopefully I will have good news.

 

 

 

can you upload the image on dropbox or something?? that be greatly appreciated

Link to comment

Wow.... it works!!

I also noticed the slow interface... I upgraded the VM to 4GB of RAM and it is snappier than before. I also use the LE VM to check that movies and tv shows have been added without having to turn on my tv set. I will probably change the skin so I can better see the "Recently Added" widgets for this purpose.

 

Thank you so much for doing this!!!. I have been trying for some time to get this working.

 

:D:D:D

 

H.

Link to comment
2 hours ago, hernandito said:

Wow.... it works!!

I also noticed the slow interface... I upgraded the VM to 4GB of RAM and it is snappier than before. I also use the LE VM to check that movies and tv shows have been added without having to turn on my tv set. I will probably change the skin so I can better see the "Recently Added" widgets for this purpose.

 

Thank you so much for doing this!!!. I have been trying for some time to get this working.

 

:D:D:D

 

H.

 

My pleasure.  Super glad I could make a meaningful contribution since I'm typically the one poking around, asking what probably seem to be dumb questions to most.  If you're a docker pro, maybe I'll PM you next time I'm messing around and struggling with my dockers.  With that said, did you ever try the Kodi docker?  What issues did you have with it that have pushed you to use a VM instead?

 

1 hour ago, Squid said:

The thing to also keep in mind is to make sure that the screen you leave the VM on when closing down the VNC window is more or less static.  IE: don't set up a screensaver, or CPU usage display, etc.  They all will needlessly increase the CPU usage of the VM

 

Yes, agreed on all fronts.  I personally would give this the most limited resources possible since the only thing you have this set up to do is update your library.  It's a shame that an entire virtual machine needs to be set up to update the library.  I imagine someone could create a script that could run a scraper independently and does not need Kodi to update MyVideos107.  Unfortunately, I'm not at that skill level yet.

Edited by Living Legend
Link to comment

Take a look at the link to the commit that I posted which got this whole thing started:

 

https://github.com/LibreELEC/LibreELEC.tv/pull/1287

 

It says there needs to be a  /etc/libvirt/qemu.conf  file with the below:

cgroup_device_acl = [
    "/dev/null", "/dev/full", "/dev/zero",
    "/dev/random", "/dev/urandom",
    "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
    "/dev/rtc","/dev/hpet", "/dev/vfio/vfio",
    "/dev/dri/renderD128"
]

I have not tried this yet, so I can't say what it will do.

Also, how have you allocated CPU & RAM to the VM?  Do you use the GUI on here much, or is it set just to update libraries?

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.