So finally I could get it working, the idea was to create a machine where I could store my media, use XBMC, and run sabnzbd, couchpotato and nzbdrone.
I've never used any Linux related OS before, so everything I did generally I barely knew what I was doing but I think I learned a little of everything at the end. I owe thanks to IronicBadger and grumpybutfun for their guides and to many others that posted their ways to do things.
Setup:
Dom0 – Arch Linux
KVM (libvirtd and quemu)
XBMC with HDMI on i5 4430 HD4600
(Running from USB drive in order to passthrough SATA)
DomU1 – unRAID 6.0 - Dockers (Sensei73 sab, drone, couch)
PCI Passthrough of MB SATA controller
CPU: i5 4430
MB: Gigabyte B85N
GPU: none (Intel HD4600)
RAM: 8Gb
HDD: 4TB 3.5", 1TB 3.5", 80GB 2.5"(from old laptop)
First I installed Arch on my 8GB pendrive, in order to do this I used another pendrive with Arch netboot image to boot and install.
I followed Ironic's guide: http://blog.ktz.me/?p=131
Observations:
I had to disable UEFI boot from my BIOS, this solved a problem where I couldn't access syslinux.cfg later because it was in another partition
I made and mounted the partitions manually, /boot (512mb) /root (4GB) /home (the rest)
Installed syslinux bootloader (just BIOS not UEFI)
Then I followed his post install tasks: http://blog.ktz.me/?p=380
Then install libvirtd and qemu: http://blog.ktz.me/?p=403
Observations:
Couldn't use the virt-manager, it required me to install gnome or other and I didn't had enough disk space after the install so I discarded this
I downloaded the un RAID_KVM_5.0.4.vhd and opened it on my windows 8 pc and changed the content to unraid 6 beta 6 and ran the make bootable .bat
Network bridge from this guide: http://blog.ktz.me/?p=120
At this point I was able to test my HVM of unRAID6, I modified a .xml from here: http://lime-technology.com/forum/index.php?topic=33859.0
Changed name to UNRAID
Changed the hard disk path to my unraid.vhd and changed the type to 'vpc'
Deleted the Virtfs 9p shares part
I used the command: virsh create unraid.xml it booted ok, so now only needed to passthrough the SATAs
Enable PCI Passthrough:
This is where everything got confusing, I had to do this: https://bbs.archlinux.org/viewtopic.php?id=162768
In that guide I enabled vfio for my SATA controller (that I wanted to passthrough to unRAID) but I had problems of something about a "iommu_group", I found out this guide: https://www.kernel.org/doc/Documentation/vfio.txt and used it to identify the iommu_group devices and did the vfio thing to all of them.
Another issue was that when I put intel_iommu=on on my syslinux.cfg , then XBMC couldn't passthrough HD audio to my AVR Receiver, video got stucked and everything bad, this got fixed by using intel_iommu=on,igfx_off
My syslinux.cfg looks like this:
LABEL archpci
TEXT HELP
Boot Arch Linux with pci passthrough
ENDTEXT
MENU LABEL Arch Linux PCI Passthrough
LINUX /boot/vmlinuz-linux quiet ipv6.disable=1 intel_iommu=on,igfx_off pci-stub.ids=8086:8c02
APPEND root=PARTUUID=bae1b7a8-74f8-4cf6-9891-cb91329fded6 rootfstype=ext4 rw rootflags=rw,relatime,data=ordered cgroup_disable=memory
INITRD /boot/initramfs-linux.img
where pci-stubs.ids is my SATA controller, and from the guide of vfio when I put lspci -k I can see the whole iommu group of devices in vfio state.
with this done, I had to follow this guide to modify the unraid.xml : https://www.suse.com/documentation/sles11/book_kvm/data/sec_libvirt_config_pci_virsh.html#
So I had to add this under <devices>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000'
bus='0x00'
slot='0x1f'
function='0x02'/>
</source>
</hostdev>
after that I was able to boot unraid6 with SATA passthrough :D :D :D
Now for sabnzbd, couchpotato, etc. I am using dockers:
I don't have a paid licence of unraid, so I configured my array like this: 4TB and 1TB on array, no parity, I left out the 80GB HDD to use for dockers, for this first I followed this guide to format it (command line method ): http://lime-technology.com/forum/index.php?topic=33806.0
Then the Quick Start Guide to learn how to use it: http://lime-technology.com/forum/index.php?topic=33805.0
I'm using sensei73's dockers, because eschultz didn't had nzbdrone and I couldn't get needo's to work.
So that was my experience, I hope is useful for someone to make a more detailed guide.
I don't know if any of this steps is useless or I miss something, I spec you gurus to tell me that, but I'm just glad It's working wonderfully, just some minor issues:
Everytime I reboot, I have to use: systemclt start libvirtd, in order to use virsh commands (yes I've tried "systemctl enable")
I need a way to autostart dockers
Also I don't know if dockers is the right way to use this apps, I did it like this because I think that having direct access to the array they will work better
I wan't to add steam to my Arch in order to use the streaming from my gaming notebook to my TV, but cant get it to work maybe Im missing a desktop GUI or something but I need a light one