Notas personales:

MODULES="pci_stub vfio vfio_pci vfio_iommu_type1 kvm kvm_amd"

#pcie_acs_override=multifunction pci-stub.ids=1002:4397,1002:4396,1002:4399,1814:0302,1106:3044 vfio-pci.ids=1002:9440,1002:aa30,1002:6779,1002:aa98
#pci-stub.ids=1002:9440,1002:aa30,1002:6779,1002:aa98,1002:4397,1002:4396
#vfio-pci.ids=1002:4385,1002:439c,1002:4383,1002:439d,1002:4384,1002:4399
#pcie_acs_override=downstream vfio_iommu_type1.allow_unsafe_interrupts=1
# ,pt,no-amd-iommu-perdev-intremap
#, iommu_inclusive_mapping=1 amd_iommu=on
#pcie_acs_override=downstream vfio_iommu_type1.allow_unsafe_interrupts=1
#pcie_acs_override=multifunction
#--------------------------------------------------------
#1002:9440 [01:00.0] VGA Radeon HD 4870
#1002:aa30 [01:00.1] Audio device
#--------------------------------------------------------
#1002:6779 [04:00.0] VGA Radeon HD 6450
#1002:aa98 [04:00.1] Audio device
#--------------------------------------------------------
#1002:4397 [00:12.0]/13.0/16.0 USB controller
#1002:4396 [00:12.2]/13.2/16.2 USB controller
#--------------------------------------------------------
#1814:0302 [06:06.0] Ralink Network controller
#1106:3044 [06:0e.0] FireWire OHCI Controller
#--------------------------------------------------------
#1002:4385 00:14.0 SMBus Controller
#1002:439c 00:14.1 IDE interface
#1002:4383 00:14.2 Audio device
#1002:439d 00:14.3 ISA bridge
#1002:4384 00:14.4 PCI bridge
#1002:4399 00:14.5 USB controller
#--------------------------------------------------------

alacarte

-device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on -vga none \
-device vfio-pci,host=01:00.1,bus=root.1,addr=00.1 \
-device vfio-pci,host=00:16.0,bus=root.1,addr=16.0 \
-device vfio-pci,host=00:16.2,bus=root.1,addr=17.0 \




-device vfio-pci,host=00:16.0 \
-device vfio-pci,host=00:16.2 \














-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device vfio-pci,host=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on -vga none \
-device vfio-pci,host=04:00.1,bus=root.1,addr=00.1 \
-device vfio-pci,host=00:12.0 \
-device vfio-pci,host=00:12.2 \
-device vfio-pci,host=00:13.0 \
-device vfio-pci,host=00:13.2 \










chmod 755 /usr/bin/vm1 && sed -i -e 's/\r$//' /usr/bin/vm1
chmod 755 /usr/bin/vfio-bind && sed -i -e 's/\r$//' /usr/bin/vfio-bind
zgrep KVM /proc/config.gz
zgrep VFIO /proc/config.gz
zgrep QEMU /proc/config.gz

echo "options kvm ignore_msrs=1" >> /etc/modprobe.d/kvm.conf
000

uname -r
radeon.blacklist=1 quiet splash nomodeset
usr/share/ovmf/
--------------------------------------------------------------------------------------------------------------------
vfio_region_write failed: Device or resource busy
BAR 0 mmap unsupported.
VFIO BAR 0 mmap unsupported. Performance may be slow
--------------------------------------------------------------------------------------------------------------------
echo 0000:00:12.0 > /sys/bus/pci/devices/0000:00:12.0/driver/unbind
echo 0000:00:12.2 > /sys/bus/pci/devices/0000:00:12.2/driver/unbind

echo "8086 10b9" > /sys/bus/pci/drivers/pci-stub/new_id
echo "1002 4397" > /sys/bus/pci/drivers/pci-stub/new_id

echo 0000:00:12.0 > /sys/bus/pci/drivers/pci-stub/bind
echo 0000:00:12.2 > /sys/bus/pci/drivers/pci-stub/bind
--------------------------------------------------------------------------------------------------------------------
#!/bin/sh
BASE="/sys/kernel/iommu_groups"
for i in $(find $BASE -maxdepth 1 -mindepth 1 -type d); do
    GROUP=$(basename $i)
    echo "### Group $GROUP ###"
    for j in $(find $i/devices -type l); do
        DEV=$(basename $j)
        echo -n "    "
        lspci -s $DEV
    done
done
--------------------------------------------------------------------------------------------------------------------
cat /boot/config-`uname -r` | grep -i "vfio"

--------------------------------------------------------------------------------------------------------------------
/usr/local/qemu-2-0-0-rc0-patched-pci/bin/qemu-system-x86_64 -name win8 -enable-kvm -M q35 -m 6144  \
-cpu Haswell,hv-time,hv_relaxed,hv_vapic,hv_spinlocks=0x1000 \
-boot order=dc \
-smp 2,sockets=1,cores=2,threads=1 \
-bios /root/vfio/bios.bin -vga none \
-usb -usbdevice tablet \
-spice port=5902,disable-ticketing \
-vnc 0.0.0.0:0 \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device ahci,bus=pcie.0,id=ahci \
-net nic \
-net tap,ifname=tap0,script=no,downscript=no \
-device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
-device vfio-pci,host=01:00.1,bus=root.1,addr=00.1 \
-device vfio-pci,host=00:14.0,bus=pcie.0 \
-drive file=/dev/mapper/vg1-winv1,media=disk,index=1,id=disk,cache=none,if=virtio \
-drive file=/dev/mapper/vg1-winv1data,media=disk,index=2,id=diskb,cache=none,if=virtio \
-drive file=/home/xen/iso/windows/en-gb_windows_8_1_enterprise_x64_dvd_2971910.iso,boot=on,media=cdrom,index=3,id=isocd  \
-device ide-cd,bus=ahci.1,drive=isocd \
-drive file=/root/virtio-win-0.1-74.iso,media=cdrom,index=4,id=virtio  \
-device ide-cd,bus=ahci.2,drive=virtio



-----------------------------
dmesg


-drive file=/dev/mapper/vg1-winv1,media=disk,index=1,id=disk,cache=none,if=virtio \
-drive file=/dev/mapper/vg1-winv1data,media=disk,index=2,id=diskb,cache=none,if=virtio \


-boot order=c -boot menu=on
-nographic
################################################################################
-soundhw hda,ac97
http://www.realtek.com.tw/downloads/downloadsCheck.aspx?Langid=1&PNid=14&PFid=23&Level=4&Conn=3&DownTypeID=3&GetDown=false
In my guest, I have disabled the high-definition audio and have installed the x64 AC'97 drivers from Realtek's website.
My audio is now clear, though there is the tiniest bit of lag occasionally.  Your mileage may vary and I'm sure there is a better way to do it, but I stopped fiddling once I'd gotten it running big_smile
################################################################################
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \

/var/lib/libvirt/images/Windows.img
################################################################################
Read the documentation in qemu-doc.html or on http://wiki.qemu-project.org
https://github.com/qemu/qemu
https://github.com/qemu/qemu/blob/master/docs/q35-chipset.cfg
################################################################################

#-smp 4,sockets=1,cores=4,threads=1 \

#-bios /usr/share/qemu/bios.bin \

#-drive file=/home/puget/windows#.img,id=disk,format=raw -device ide-hd,bus=ide.0,drive=disk \

#Installed windows, initial BSOD was because of -cpu host , needed -cpu SandyBridge instead.

#-drive file=/Windows/A/win7.iso,id=isocd -device ide-cd,bus=ide.1,drive=isocd \

#-usb -usbdevice host:046d:c019 -usbdevice host:0603:00f2 \

#-daemonize

#-net nic -net tap,ifname=tap0,script=no,downscript=no,vhost=on \

#-net nic -net user
 #-parallel none
#-bios /usr/share/qemu/bios.bin

#-cdrom /Windows/A/win7.iso \

#-device virtio-scsi-pci,id=scsi \

#-drive file=/Windows/C/LadyMalwil.vhd,id=disk,format=raw,if=none -device scsi-hd,drive=disk \

#-drive file=/Windows/A/win7.iso,id=isocd,if=none -device scsi-cd,drive=isocd \

#-cdrom /Windows/A/Programas/Sistema/Drivers/VirtIO_Drivers/virtio-win-0.1.109.iso \

#-vnc 127.0.0.1:1 -usbdevice tablet

################################################################################
http://www.3djuegos.com/comunidad-foros/tema/31937813/0/error-atikmdag-sys-de-amd-y-solucion-para-los-pantallazos-azules-del-infierno/
################################################################################
AMD platform worked basically out of the box, because nbhs has very similar setup (chipset is the same).  Intel, however, was a bit tougher to get working because of Catalyst 13.9 atikmpag.sys' code 116 BSOD which was finally solved thanks to recent posts from aw and gentoo-nut by simply ommiting the HDMI Audio completely (or adding it to pcie.0 bus works as well).
I would like to Thank nbhs, aw and all you guys who share the information about setups, related issues and their solutions on this thread.  I wouldn't be able to get the thing working without you :-).
################################################################################
qemu-system-x86_64 -enable-kvm -M q35 -m 4096 -cpu host \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device vfio-pci,host=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on -vga none \
-device vfio-pci,host=04:00.1,bus=root.1,addr=00.1 \
-boot menu=on

-hda /dev/sda

-cdrom  file=/mnt/A/win7.iso \
################################################################################
nano /etc/libvirt/qemu.conf
OVMF
/dev/vfio/vfio
systemctl stop libvirtd.service && systemctl start libvirtd.service
################################################################################
http://askubuntu.com/questions/307066/i-cant-add-domain-type-kvm-xmlnsqemu-http-libvirt-org-schemas-domain-qe

EDITAR CONFIGURACIÓN DE LIBVIRT:
nano /etc/libvirt/qemu.conf


EDITOR=nano virsh edit LordZiru
EDITOR=nano virsh edit LadyMalwil

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=04:00.0,bus=root.1,addr=01.0,multifunction=on,x-vga=on,rombar=0,romfile=/root/XFX.HD5450.1024.110612.rom'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=04:00.1,bus=root.1,addr=01.1'/>
  </qemu:commandline>


    <qemu:arg value='vfio-pci,host=04:00.0,bus=root.1,addr=01.0,multifunction=on,x-vga=on,rombar=0,romfile=/root/XFX.HD5450.1024.110612.rom'/>
"-set", "device.hostdev0.x-vga=on"
################################################################################
nano /etc/mkinitcpio.conf

MODULES="pci_stub vfio vfio_iommu_type1 vfio_pci kvm kvm_amd"

[ARCHLINUX] Actualizar mkinitcpio
mkinitcpio -p linux
################################################################################
nano /etc/default/grub
iommu=1 amd_iommu=on

pci-stub.ids=1002:9440,1002:aa30,1002:aa68,1002:4383,1002:4384,1002:4385,1002:4396,1002:4397,1002:4399,1002:439c,1002:439d,1002:68f9,1814:0302,1b6f:7023

iommu=pt

[ARCHLINUX] Actualizar Grub
grub-mkconfig -o /boot/grub/grub.cfg
################################################################################
lsblk

ntfs-3g /dev/sda1 /mnt/C && ntfs-3g /dev/sdb1 /mnt/A && mount /dev/sdb2 /mnt/B

umount /dev/sda1 && umount /dev/sdb1 && umount /dev/sdb2

/var/lib/libvirt/images



echo && echo  && echo && echo  && echo  && echo  && echo  && echo  && echo &&\
echo -------------------------------------- &&\
echo -- Disco /dev/sda1: &&\
lsblk -no UUID /dev/sda1 &&\
echo -------------------------------------- &&\
echo -- Disco /dev/sdb1: &&\
lsblk -no UUID /dev/sdb1 &&\
echo -------------------------------------- &&\
echo -- Disco /dev/sdb2: &&\
lsblk -no UUID /dev/sdb2 &&\
echo --------------------------------------


#--------------------------------------
#-- Disco /dev/sda1:
UUID=4C408B48408B37AA                /mnt/C    ntfs    defaults    0    0
#--------------------------------------
#-- Disco /dev/sdb1:
UUID=8EC25F2FC25F1B33                /mnt/A    ntfs    defaults    0    0
#--------------------------------------
#-- Disco /dev/sdb2:
UUID=6ee4f064-0bcb-4294-a413-544f4c0b0467    /mnt/B    ext4    defaults    0    0
#--------------------------------------

nano /etc/fstab
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################################################################################################################################################################################
VMware vSphere Hypervisor 5 License     J0693-A2K94-Q8340-030U0-1MF73
VMware vSphere Hypervisor 6 License     4M286-8UKE2-18T81-0J88K-2DN3J
################################################################################################################################################################################################################################################
1002:9440,1002:aa30,1002:68f9,1002:aa68,1002:4385,1002:439c,1002:4383,1002:439d,1002:4384,1002:4399,1002:4397,1002:4396,1002:4397,1002:4396,1002:4397,1002:4396,1002:4385,1002:439c,1002:4383,1002:439d,1002:4384,1002:4399,1002:4397,1002:4396,1b6f:7023,1814:0302



pci_stub vfio vfio_iommu_type1 vfio_pci kvm kvm_amd




1002:9440 01:00.0 VGA Radeon HD 4870
1002:aa30 01:00.1 Audio device

1002:6779 04:00.0 VGA Radeon HD 6450
1002:aa98 04:00.1 Audio device

1002:4397 00:12.0/00:13.0/00:16.0 USB controller
1002:4396 00:12.2/00:13.2/00:16.2 USB controller


lspci -nn | grep 01:00.
lspci -nn | grep 04:00.
lspci -nn | grep 00:12.
lspci -nn | grep 00:13.
lspci -nn | grep 00:14.
lspci -nn | grep 00:16.

lspci -nn | grep 02:00.
lspci -nn | grep 07:00.
lspci -nn | grep 05:06.
################################################################################################################################################################################################################################################
atikmpag.sys
################################################################################################################################################################################################################################################
im using xen-4.1 not because xen-4.2+ broke anything, simply because the xl toolstack doesnt support resseting passthru'd devices, what you're refering about not working on broken ivrs tables is this: XSA-36
which is also applied on xen 4.1.5, so i had to hack the xen code to make it work, which can aslo be applied (well it has to be modified a little) to xen-4.2+ ( i tried, it worked)

Included in my build i attached said fix, i have no idea if it breaks working builds, but im sure it works in our boards.

xm dmesg

...
(XEN) IOAPIC[0]: apic_id 9, version 33, address 0xfec00000, GSI 0-23
(XEN) IOAPIC[1]: apic_id 10, version 33, address 0xfec20000, GSI 24-55
(XEN) Enabling APIC mode:  Flat.  Using 2 I/O APICs
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Detected 4414.882 MHz processor.
(XEN) Initing memory sharing.
(XEN) AMD-Vi: IOMMU 0 Enabled.
(XEN) AMD-Vi: Enabling per-device vector maps
(XEN) I/O virtualisation enabled
(XEN)  - Dom0 mode: Relaxed
(XEN) Interrupt remapping enabled
...


The other 2 patches included, is a patch to load the bios from your card from here: http://markmail.org/message/7gb7djbmlaxruaai, which is important if you wish to passthrough a host secon
https://bbs.archlinux.org/viewtopic.php?pid=1275252#p1275252

http://markmail.org/message/7gb7djbmlaxruaai
http://lists.xen.org/archives/html/xen-devel/2012-12/msg00009.html
http://old-list-archives.xenproject.org/archives/html/xen-devel/2010-12/msg00705.html

######################################################################################################################################################################################
https://bbs.archlinux.org/viewtopic.php?pid=1275017#p1275017
Even though this is a kvm thread, i wanna share some of my experiences with XEN, and how to get PRIMARY vga passthrough ( gfx_passthru = 1 ) on radeon cards.

Sooooo, this is basically what im doing, i'm passing through my secondary radeon ( 6950 ) card ( although you can also pass your primary card), as a primary vga (without cirrus emulated card), my usb3 ports, and my sata controller with my 2TB disk connected to it, using a DUET image ( see http://www.rodsbooks.com/bios2uefi/ ), booting windows server 2008 on UEFI Mode straight from the controller ( no emulated disk controller ), with a hacked xen to enable intremap on my broken Asus crosshair v formula ivrs table, using the XM toolstack.

This is the package i use, xen-4.1.5 based on xen-4.2.2 from AUR: xen.tar.gz

I commented out my hack @ line 37 because this might break working systems.

Once extracted you'll find a file called vgabios-pt.bin. That is the rom file for my 6950, you have to dump your card's rom or d/l it from http://www.techpowerup.com/vgabios/, and replace that file with yours.

AFTER you copy your rom, build xen, install it then enable the needed services:

systemctl enable xenstored
systemctl enable xend

Now you need to actually boot xen so we create a new file called 05_xen @ /etc/grub.d

nano -w /etc/grub.d/05_xen

The fist 2 lines:

#!/bin/sh
exec tail -n +3 $0

For the rest the easiest way and the only one i'll describe here is to copy an entry from you /boot/grub/grub.cfg file:

cat /boot/grub/grub.cfg

Now copy the first menuentry to 05_xen:

menuentry 'Arch GNU/Linux, with Linux....
{
....
....
}

Add this line on top of "echo    'Loading Linux core repo kernel .":

multiboot    /xen-4.1.5.gz

Modify "linux    /vmlinuz-linux" to "module    /vmlinuz-linux" and "initrd    /initramfs-linux" to "module    /initramfs-linux"

Make 05_xen executable

chmod +x /etc/grub.d/05_xen

Edit /etc/mkinitcpio.conf and include xen-pciback

MODULES="xen-pciback"

If you wish to bind a device on boot to pciback modify 05_xen like this:

module    /vmlinuz-linux root=/dev/mapper/system-root ro xen-pciback.passthrough=1 xen-pciback.permissive=1 xen-pciback.hide=(07:00.0)(07:00.1)

Update grub.cfg

grub-mkconfig -o /boot/grub/grub.cfg

Reboot and check everything is works

xm info | grep virt_caps

virt_caps              : hvm hvm_directio

After this point if everything is working i suggest you read the xen documentation on how to create a vm, this is my configuration:

kernel = "hvmloader"
builder='hvm'
memory = 8192
name = "hvm"
cpus = [ "2", "3", "4", "5", "6", "7" ]
vcpus = 6
disk = [ 'file:/root/xen/images/duet.img,hda,w' ]
pci = [ '00:11.0', '04:00.0', '05:00.0', '06:00.0', '0000:07:00.*' ]
vif = [ 'bridge=br0' ]
gfx_passthru = 1
localtime = 1
xen_platform_pci = 1
pci_power_mgmt = 1
pci_msitranslate = 0
viridian = 1

How i got windows to boot from my sata controller using qemu-dm and DUET

Notice this line:

disk = [ 'file:/root/xen/images/duet.img,hda,w' ]

This is the duet image i've been writing about, its a 200MB image containing DUET and REFIND ( http://www.rodsbooks.com/refind )( also included is a efi driver dump of the controller for RAID mode (sb950), so you can boot on RAID but i havent experimented with it much )

Duet image here: Duet.img.zip

The boot sequence is like this ROMBIOS-->DUET-->WINDOWS.

Duet contains drivers for the controller in ahci mode, it finds the windows efi partition and boots from it.

Radeon xen primary passthrough on xen:

dEGPaNI.jpg

Duet with REFIND booting windows ( with gfx_passthu = 0 to take the screenshot ):

S1bLj7P.png
####################################################################################################################################################################################
http://www.withopf.com/tools/deveject/deveject-11.zip

    Gratz, the script should work tho, run cmd.exe as admin and execute

     deveject.exe -EjectId:"PCI\VEN_1002&DEV_6719&SUBSYS_31221682&REV_00\4&184E0D10&0&00E0"

    change pci\ven.... to match yours, its works the same as manually ejecting so there's prolly a typo somewhere

yeah. running deveject.exe manually is running fine. Only if I want to run it automatically at shutdown (with dpedit.msc script) it isn't working.

Offline
#35 2013-05-18 03:24:37

nbhs
    Member
    From: Montevideo, Uruguay
    Registered: 2013-05-02
    Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

copy deveject.exe to C:\Windows\System32\deveject.exe and try again, you need to put the full path under "Script name" and the rest under "Script Parameters" -->
-EjectId:"PCI\VEN_1002&DEV_6719&SUBSYS_31221682&REV_00\4&184E0D10&0&00E0"

####################################################################################################################################################################################
Would be great if i could use the Primary VGA card as well, Xen was able to pass it through, I'm not sure what's preventing Qemu/KVM from doing so.

Managed to get the primary card working too, it requires booting in text-only mode, passing 'nomodeset' and 'nofb' to the linux kernel, blacklisting the radeon driver, and switching grub to use text mode only.

################################################################################
lspci -nn | grep 01:00.
lspci -nn | grep 04:00.
lspci -nn | grep 00:12.
lspci -nn | grep 00:13.
lspci -nn | grep 00:14.
lspci -nn | grep 00:16.
lspci -nn | grep 02:00.
lspci -nn | grep 07:00.
lspci -nn | grep 05:06.
################################################################################
01:00.0 [1002:9440] VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] RV770 [Radeon HD 4870]

01:00.1 [1002:aa30] Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] RV770 HDMI Audio [Radeon HD 4850/4870]

04:00.0 [1002:68f9] VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Cedar [Radeon HD 5000/6000/7350/8350 Series]

04:00.1 [1002:aa68] Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Cedar HDMI Audio [Radeon HD 5400/6300 Series] [1002:aa68]

00:12.0 [] USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.0 [1002:4397] USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:16.0 [1002:4397] USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller

00:12.2 [1002:4396] USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.2 [1002:4396] USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:16.2 [1002:4396] USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller

00:14.0 [1002:4385] SMBus [0c05]: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller  (rev 42)

00:14.1 [1002:439c] IDE interface [0101]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 IDE Controller  (rev 40)

00:14.2 [1002:4383] Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA)  (rev 40)

00:14.3 [1002:439d] ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 LPC host controller  (rev 40)

00:14.4 [1002:4384] PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 PCI to PCI Bridge (rev 40)

00:14.5 [1002:4399] USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller

02:00.0 [1b6f:7023] USB controller [0c03]: Etron Technology, Inc. EJ168 USB 3.0 Host Controller (rev 01)
07:00.0 [1b6f:7023] USB controller [0c03]: Etron Technology, Inc. EJ168 USB 3.0 Host Controller  (rev 01)

05:06.0 [1814:0302] Network controller [0280]: Ralink corp. RT2561/RT61 rev B 802.11g
################################################################################
https://wiki.archlinux.org/index.php/Disable_clearing_of_boot_messages
https://bbs.archlinux.org/viewtopic.php?id=33497
discussions.citrix.com/topic/338545-hotfix-xs62e005-gpu-passthrough-on-single-gpu-host/
################################################################################
chkconfig sshd on

################################################################################
VMWARE ESXI
No se pueden asignar los usb controller 2.0, los 3.0 sí
no importa nada de EFI o no EFI.
agregando los devices como owner=passthou o algo así no sirve tampoco.
################################################################################
support.citrix.com/article/CTX118198
################################################################################
https://tapiocavirtual.wordpress.com/2010/09/19/tutorial-citrix-xenserver-criando-repositrio-iso/
################################################################################
discussions.citrix.com/topic/345143-useful-pci-passthrough-script-along-with-a-question/
xmodulo.com/how-to-disable-xsconsole-autorun-in-xenserver.html
vi /opt/xensource/libexec/run-boot-xsconsole
#!/bin/bash
TTY=$1
#exec /sbin/mingetty --noissue --autologin root --loginprog=/usr/bin/xsconsole $TTY
exec /sbin/mingetty --noissue --noclear $TTY
xmodulo.com/category/xenserver
################################################################################
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
xl pci-assignable-add 00:12.0
xl pci-assignable-add 00:12.2
xl pci-assignable-add 00:13.0
xl pci-assignable-add 00:13.2
########################################################################

sudo yum --enablerepo=rpmforge --disablerepo=citrix --disablerepo=base install virt-manager

 --disablerepo=
sudo yum --enablerepo=base --disablerepo=citrix install traceroute

################################################################################
sudo yum repolist enabled &&
sudo yum --enablerepo=base --disablerepo=citrix install traceroute &&
sudo sed -i -e "s/enabled=0/enabled=1/" /etc/yum.repos.d/CentOS-Base.repo &&
 yum install xorg-x11-xauth

sudo yum install gcc
sudo yum --enablerepo=updates traceroute

################################################################################
Paquetes necesarios linux:
yum install xorg-x11-xauth openssh qemu libvirt virt-manager
################################################################################
ESXi:
vi /etc/vmware/esx.conf
www.vm-help.com/esx/esx3i/esx_3i_rcli/vifs.php
www.vm-help.com/index.html
www.vm-help.com/esx40i/VMDirectPath/fix_config_issues.php
kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2001780

################################################################################
https://www.pugetsystems.com/labs/articles/Multi-headed-VMWare-Gaming-Setup-564/

magnet:?xt=urn:btih:D1FB1A3667763A045056890D87A69547558B0439&dn=vmware+vsphere+5+x&tr=udp%3A%2F%2Fopen.demonii.com%3A1337%2Fannounce
################################################################################
What if VGA passt
hrough doesn't work?

If you can't get your VGA adapter to pass through to Windows, there are some options you may want to check:

a) First make absolutely sure your graphics adapter is supported !!! See my lengthy introduction to hardware requirements. Unless you have a Nvidia "multi-OS" graphics adapter, AMD will be a better choice. Have a look at the following threads/blogs for more information on VGA passthrough and adapters:

http://www.overclock.net/t/1307834/xen-vga-passthrough-compatible-graphics-adapters

http://www.overclock.net/t/1205216/guide-create-a-gaming-virtual-machine - New updated instructions for Fedora 20

https://dl.dropboxusercontent.com/u/2259891/xen-hvm-vga-passthrough.pdf

http://gro.solexiv.de/2012/08/pci-passthrough-howto/

http://wiki.xen.org/wiki/Xen_VGA_Passthrough

http://wiki.xen.org/wiki/Xen_VGA_Passthrough_Tested_Adapters
This page seems a bit outdated, but probably the safest reference when purchasing a graphics card.

http://www.phoronix.com/scan.php?page=news_item&px=MTA3NjA - this is the complicated way to get Xen VGA passthrough with Nvidia cards (see link inside the text). This procedure should work with some Nvidia cards that are NOT "multi-OS".

http://www.davidgis.fr/blog/index.php?2011/12/07/860-xen-42unstable-patches-for-vga-pass-through - this is currently THE resource for instructions and patches when you want or need to compile the Xen hypervisor. This is specifically for Nvidia cards that don't have native support for VGA passthrough.


################################################################################
https://www.kernel.org/doc/Documentation/vfio.txt
http://lists.linux-foundation.org/pipermail/virtualization/2013-July/024719.html
http://www.firewing1.com/howtos/fedora-20/create-gaming-virtual-machine-using-vfio-pci-passthrough-kvm
http://forums.linuxmint.com/viewtopic.php?f=42&t=112013&start=360
https://pve.proxmox.com/wiki/Pci_passthrough
https://lkml.org/lkml/2013/5/30/513
https://en.wikibooks.org/wiki/QEMU/Images
https://www.pugetsystems.com/labs/articles/Multiheaded-NVIDIA-Gaming-using-Ubuntu-14-04-KVM-585/
################################################################################
################################################################################
ACTIVAR LA EJECUTACIÓN DE UN ARCHIVO:
chmod +x <name>
################################################################################
vi /boot/extlinux.conf

amd_iommu=on iommu=1,pt,no-amd-iommu-perdev-intremap iommu_inclusive_mapping=1

no-amd-iommu-perdev-intremap
iommu=1 iommu_inclusive_mapping=1
iommu=1 amd_iommu=on iommu=pt
extlinux /boot

xl dmesg | grep AMD-Vi
xl dmesg | grep IOMMU
xl dmesg | grep failed
################################################################################
This section explains how to use GPU Pass-through to assign a PCI graphics card to a guest operating system.

The following is a detailed step-by-step guide for XenServer 5.6, provided that your system meets the hardware and firmware requirements described in the preceding section.

    Enable IOMMU on the host.
    Edit “/boot/extlinux.conf” and add
    iommu=1 iommu_inclusive_mapping=1 right after all the instances of /boot/xen.gz
    As an example a line with those options looks like this:
    append /boot/xen.gz iommu=1 iommu_inclusive_mapping=1 com1=115200,8n1 console=com1,vga dom0_mem=752M lowmem_emergency_pool=1M crashkernel=64M@32M --- /boot/vmlinuz-2.6-xen root=LABEL=root-rqrdbtjz ro console=tty0 xencons=hvc console=hvc0 --- /boot/initrd-2.6-xen.img


    Regenerate the bootloader executing: extlinux /boot

    Run the following command as root on the XenServer host:
    echo ‘modprobe pciback’ >> /etc/rc.local
    Restart the XenServer host:
    Check if 'pciback' module is loaded in dom0 using
    #lsmod | grep pciback

    If it is not loaded then use following command to load 'pciback'
    #modprobe pciback

    To verify if 'pciback' is successfully loaded use following command
    #lsmod | grep pciback

    It should show the output like below
    pciback     37768 0
    Assign a PCI graphics card to a virtual machine. Get a list of PCI devices in the system executing lspci. You should see one or more devices like this:
    02:00.0 VGA compatible controller: nVidia Corporation GT200GL [NVIDIA Quadro FX 3800] (rev a1)
    Assign one of them to a virtual machine executing the following command:
    xe vm-param-set other-config:pci=0/0000:02:00.0 uuid=uuid_of_the_VM
    where 02:00.0 is the PCI bus address of the graphics card you want to assign
    Use the command xe vm-list to get the uuid of the virtual machine.
    Start the virtual machine and install the correct driver for the new device. NVIDIA Display Adapter should be seen in Computer Management > Device Manager > Display Adapter which indicates that the GPU direct mapping is successful.
    Install XenDesktop Virtual Desktop Agent followed by HDX 3D Pro Graphics on the virtual machine.

################################################################################
nano /etc/default/grub

iommu=1 amd_iommu=on iommu=pt
pcie_acs_override=downstream vfio_iommu_type1.allow_unsafe_interrupts=1
rd.driver.pre=vfio-pci

ARCHLINUX
grub-mkconfig -o /boot/grub/grub.cfg

CENTOS
grub2-mkconfig -o "$(readlink /etc/grub2.conf)"
################################################################################
01:00.0 Radeon HD 4850/4870 Video [1002:9440]
01:00.1 Radeon HD 4850/4870 Audio [1002:aa30]

04:00.0 Radeon HD 5450 Video [1002:68f9]
04:00.1 Radeon HD 5450 Audio [1002:aa68]

Solo HD5450:
pci-stub.ids=1002:68f9,1002:aa68

Las dos placas de video:
pci-stub.ids=1002:68f9,1002:aa68,1002:9440,1002:aa30

echo "1002 68f9" > /sys/bus/pci/drivers/vfio-pci/new_id
echo "1002 aa68" > /sys/bus/pci/drivers/vfio-pci/new_id




echo "1002 68f9" > /sys/bus/pci/drivers/pci-stub/new_id
echo "1002 aa68" > /sys/bus/pci/drivers/pci-stub/new_id


DEVICES="0000:04:00.0 0000:04:00.1"
mkdir -p /etc/sysconfig
################################################################################
ip link
ip link set eth0 up

REVISAR DISPOSITIVOS LISTO PARA PASAR:
ls /dev/vfio

LISTA DE DISCOS DUROS:
lsblk

ADMINISTRADOR DE PROCESOS:
htop

INFORMACIÓN DE HARDWARE PCI:
lspci -v

INFORMACIÓN DE VGA:
lspci | grep VGA
lspci -nn|grep -iP "NVIDIA|Radeon"

Saber ip local
ip -s route
dmesg | grep -iP AMD-Vi|IOMMU
dmesg|grep AMD-Vi
dmesg|grep IOMMU

INICIAR EL DEMONIO DE LIB VIRT
systemctl start libvirtd.service

lsmod | grep -e pci -e vfio -e kvm| tail -n 6
cat /etc/modules | grep -e vfio -e pci

EDITAR SSHD
nano /etc/ssh/sshd_config
systemctl restart sshd.service

INFORMACIÓN DEL DISPLAY OVER SSH
set | grep DISPLAY
CAMBIAR DISPLAY:
export DISPLAY=127.0.0.1:0.0

################################################################################
EDITAR CONFIGURACIÓN DE LIBVIRT:
nano /etc/libvirt/qemu.conf

################################################################################
qemu-system-x86_64 -enable-kvm -m 512 -hda Ziru7.img -cdrom win7.iso -boot d -device vfio-pci,host=04:00.0,multifunction=on,x-vga=on -device vfio-pci,host=04:00.1

qemu-system-x86_64 -enable-kvm -m 512 -hda Ziru7.img -cdrom win7.iso -boot d -device pci-assign,host=04:00.0 -device pci-assign,host=04:00.1

qemu-system-x86_64 -enable-kvm -nographic -vga none -m 512 -hda Ziru7.img -cdrom win7.iso -boot d -device vfio-pci,host=04:00.0,multifunction=on,x-vga=on -device vfio-pci,host=04:00.1
 -device vfio-pci,host=04:00.0,addr=09.0,multifunction=on \
        -device vfio-pci,host=04:00.1,addr=09.1

qemu-system-x86_64 -enable-kvm -m 512 -hda Ziru7.img -cdrom win7.iso -boot d -device pci-assign,host=04:00.0 -device pci-assign,host=04:00.1 -nographic -vga none

qemu-system-x86_64 -enable-kvm -nographic -vga none -m 512 -hda Ziru7.img -cdrom win7.iso -boot d -device vfio-pci,host=04:00.0,multifunction=on,x-vga=on -device vfio-pci,host=04:00.1

-device pci-assign,
-device pci-assign,host=

qemu-system-x86_64: -device vfio-pci,host=04:00.0,id=hostdev0,bus=pci.0,addr=0x8






 -m 512  -cdrom win7.iso -boot d -device vfio-pci,host=04:00.0,multifunction=on,x-vga=on -device vfio-pci,host=04:00.1


qemu-system-x86_64 \
        -serial none \
        -parallel none \
        -nodefconfig \
        -enable-kvm \
        -name Windows \
        -m 1024 \
        -device ich9-usb-uhci3,id=uhci \
        -device usb-ehci,id=ehci \
        -device nec-usb-xhci,id=xhci \
    -hda Ziru7.img \
    -cdrom win7.iso \
        -rtc base=localtime \
        -boot order=c \
        -nographic \
        -device vfio-pci,host=04:00.0,addr=09.0,multifunction=on \
        -device vfio-pci,host=04:00.1,addr=09.1



################################################################################

to bypass the SDL
qemu -curses
qemu -nographic

Check IOMMU:
dmesg | grep AMD-Vi
################################################################################

mount -t ntfs /dev/sdc1 /mnt/A/


systemctl restart libvirtd
systemctl restart dhcpcd

################################################################################

echo "1002 68f9" > /sys/bus/pci/drivers/pci-stub/new_id
echo 0000:04:00.0 > /sys/bus/pci/devices/0000:04:00.0/driver/unbind
echo 0000:04:00.0 > /sys/bus/pci/drivers/pci-stub/bind

echo "1002 aa68" > /sys/bus/pci/drivers/pci-stub/new_id
echo 0000:04:00.1 > /sys/bus/pci/devices/0000:04:00.1/driver/unbind
echo 0000:04:00.1 > /sys/bus/pci/drivers/pci-stub/bind

nano /sys/bus/pci/drivers/pci-stub/new_id
nano /sys/bus/pci/drivers/pci-stub/bind


Ctrl+Alt+2 to open QEMU monitor and 'quit'

or Ctrl+A+C when you're using -nographics

qemu-system-x86_64 \
  -enable-kvm \
  -m 2048 \
  -cpu host,kvm=off \
  -vga none \
  -device vfio-pci,host=04:00.1 \
  -device vfio-pci,host=04:00.0

################################################################################

XenServer 6.2: How to set up passthrough of a PCI or PCI-Express device
XenServer 6.2: How to set up passthrough of a PCI or PCI-Express device
sotech January 5, 2014 How-To, Server, XenServer No Comments



This is done by logging in as the root user to your XenServer system via SSH. To see the PCI devices available to your system, enter the following command:



    lspci



Here is an example result:



    00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 Northbridge only dual slot (2Ṫ16) PCI-e GFX Hydra part (rev 02)
    00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD/ATI] RD990 I/O Memory Management Unit (IOMMU)
    00:02.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port B)
    00:09.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port H)
    00:0a.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (external gfx1 port A)
    00:0b.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (NB-SB link)
    00:0c.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890S PCI Express bridge for GPP2 port 1
    00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode]
    00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
    00:12.1 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0 USB OHCI1 Controller
    00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
    00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
    00:13.1 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0 USB OHCI1 Controller
    00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
    00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller (rev 3d)
    00:14.1 IDE interface: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 IDE Controller
    00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 LPC host controller
    00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 PCI to PCI Bridge
    00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
    00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 0
    00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 1
    00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 2
    00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 3
    00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 4
    00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 5
    00:19.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 0
    00:19.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 1
    00:19.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 2
    00:19.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 3
    00:19.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 4
    00:19.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 5
    00:1a.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 0
    00:1a.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 1
    00:1a.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 2
    00:1a.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 3
    00:1a.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 4
    00:1a.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 5
    00:1b.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 0
    00:1b.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 1
    00:1b.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 2
    00:1b.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 3
    00:1b.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 4
    00:1b.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 5
    01:01.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 10)
    01:03.0 Multimedia audio controller: C-Media Electronics Inc CMI8788 [Oxygen HD Audio]
    02:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
    03:00.0 Multimedia controller: Philips Semiconductors SAA7164 (rev 81)
    04:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
    05:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
    06:00.0 InfiniBand: Mellanox Technologies MT26418 [ConnectX VPI PCIe 2.0 5GT/s – IB DDR / 10GigE] (rev b0)

As you might guess from some of the lines, it’s an AMD server. You’ll notice some USB controllers, likely a SATA controller and any PCI or PCI Express add-in cards (usually at the bottom). In this example we will pass through a digital TV card to a VM so we can record free-to-air TV. The controller here is the fourth-last entry:



    03:00.0 Multimedia controller: Philips Semiconductors SAA7164 (rev 81)



It’s a Digital Now PCI-E card – as you can see there’s no mention of the brand in the chipset that the system can see, so you may have to make an educated guess (or do some research as to what’s actually used in the card) to determine which one you want. Making note of the above line, we now edit /boot/extlinux.conf:



    vi /boot/extlinux.conf



In our example system it looks like this:



    # location mbr
    serial 0 115200
    default xe
    prompt 1
    timeout 50

    label xe
    # XenServer
    kernel mboot.c32
    append /boot/xen.gz mem=1024G dom0_max_vcpus=4 dom0_mem=4096M,max:4096M watchdog_timeout=300 lowmem_emergency_pool=1M crashkernel=64M@32M cpuid_mask_xsave_eax=0 console=vga vga=mode-0x0311 — /boot/vmlinuz-2.6-xen root=LABEL=root-ckwntldj ro xencons=hvc console=hvc0 console=tty0 quiet vga=785 splashi  — /boot/initrd-2.6-xen.img

    label xe-serial
    # XenServer (Serial)
    kernel mboot.c32
    append /boot/xen.gz com1=115200,8n1 console=com1,vga mem=1024G dom0_max_vcpus=4 dom0_mem=4096M,max:4096M watchdog_timeout=300 lowmem_emergency_pool=1M crashkernel=64M@32M cpuid_mask_xsave_eax=0 — /boot/vmlinuz-2.6-xen root=LABEL=root-ckwntldj ro console=tty0 xencons=hvc console=hvc0 — /boot/initrd-2.6-xen.img

    label safe
    # XenServer in Safe Mode
    kernel mboot.c32
    append /boot/xen.gz nosmp noreboot noirqbalance acpi=off noapic mem=1024G dom0_max_vcpus=4 dom0_mem=4096M,max:4096M com1=115200,8n1 console=com1,vga — /boot/vmlinuz-2.6-xen nousb root=LABEL=root-ckwntldj ro console=tty0 xencons=hvc console=hvc0 — /boot/initrd-2.6-xen.img

    label fallback
    # XenServer (Xen 4.1.5 / Linux 2.6.32.43-0.4.1.xs1.8.0.835.170778xen)
    kernel mboot.c32
    append /boot/xen-4.1.5.gz mem=1024G dom0_max_vcpus=4 dom0_mem=4096M,max:4096M watchdog_timeout=300 lowmem_emergency_pool=1M crashkernel=64M@32M cpuid_mask_xsave_eax=0 — /boot/vmlinuz-2.6.32.43-0.4.1.xs1.8.0.835.170778xen root=LABEL=root-ckwntldj ro xencons=hvc console=hvc0 console=tty0 — /boot/initrd-2.6.32.43-0.4.1.xs1.8.0.835.170778xen.img

    label fallback-serial
    # XenServer (Serial, Xen 4.1.5 / Linux 2.6.32.43-0.4.1.xs1.8.0.835.170778xen)
    kernel mboot.c32
    append /boot/xen-4.1.5.gz com1=115200,8n1 console=com1,vga mem=1024G dom0_max_vcpus=4 dom0_mem=4096M,max:4096M watchdog_timeout=300 lowmem_emergency_pool=1M crashkernel=64M@32M cpuid_mask_xsave_eax=0 — /boot/vmlinuz-2.6.32.43-0.4.1.xs1.8.0.835.170778xen root=LABEL=root-ckwntldj ro console=tty0 xencons=hvc console=hvc0 — /boot/initrd-2.6.32.43-0.4.1.xs1.8.0.835.170778xen.img

Rather an intimidating-looking file if you’re new to *nix config files. Fortunately, we can ignore most of this and just pay attention to the last line in the “label xe” section at the top. The line we want to edit is:



    append /boot/xen.gz mem=1024G dom0_max_vcpus=4 dom0_mem=4096M,max:4096M watchdog_timeout=300 lowmem_emergency_pool=1M crashkernel=64M@32M cpuid_mask_xsave_eax=0 console=vga vga=mode-0x0311 — /boot/vmlinuz-2.6-xen root=LABEL=root-ckwntldj ro xencons=hvc console=hvc0 console=tty0 quiet vga=785 splashi  — /boot/initrd-2.6-xen.img



Looking at the line we wanted from lspci above, we want the number at the front – in this case:



    03:00.0



Add the following near the end of the config line – inbetween “splashi” and “—“:



    pciback.hide=(03:00.0)



The line should now read:



      append /boot/xen.gz mem=1024G dom0_max_vcpus=4 dom0_mem=4096M,max:4096M watchdog_timeout=300 lowmem_emergency_pool=1M crashkernel=64M@32M cpuid_mask_xsave_eax=0 console=vga vga=mode-0x0311 — /boot/vmlinuz-2.6-xen root=LABEL=root-ckwntldj ro xencons=hvc console=hvc0 console=tty0 quiet vga=785 splashi pciback.hide=(03:00.0) — /boot/initrd-2.6-xen.img

Note the space on either side – one between splashi and the new text and one between the hyphens and the new text. Now run:



    extlinux -i /boot



Then shut down any VMs and reboot the server:



    reboot



Once it is back up, we need to find the UUID of the virtual machine we want to pass the device through to. Run:



    xe vm-list



This will return a result for every VM on the system – it might be quite long! If it is a long list you may wish to pipe it to the less command for easier viewing:



    xe vm-list | less



If you aren’t familiar with less you can exit with the “q” key. Sort through the list until you find the VM you want to pass through to. In this example it is:



    uuid ( RO)           : 6b664553-6822-b445-5a8c-c10d93c41c4c
    name-label ( RW): bacchus
    power-state ( RO): halted

Now we can add the PCI device to the config of this VM:



    xe vm-param-set other-config:pci=0/0000:03:00.0 uuid=6b664553-6822-b445-5a8c-c10d93c41c4c



Breaking that down:



    xe vm-param-set other-config:pci=0/0000:[PCI address for the device] uuid=[UUID of VM]



Starting the VM – in this case a Windows 7 VM – we can check for the device to see that it has appeared (in this case the drivers were already installed so it has been immediately identified):



xenserver-passthrough-to-windows

Success! In a Linux system you should be able to do:



    lspci



to see the newly passed through hardware.
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################

Instalacion


Poner teclado en Español:
# loadkeys es

-----------------------------------------------
Particionado:
-----------------------------------------------

Listar discos:
# lsblk

Herramienta de particionado:
# cfdisk

Crear sistema de archivos:
# mkfs.ext4 /dev/sda1
# mkfs.ext4 /dev/sda2
# mkswap /dev/sda3


Montar disco principal:
# mount /dev/sda1 /mnt

Crear directorio para la particion /boot:
# mkdir -p /mnt/boot
Montar disco de la particion /boot:
# mount /dev/sda2 /mnt/boot


-----------------------------------------------
Instalacion:
-----------------------------------------------

Instalar el sistema base:
# pacstrap -i /mnt base base-devel


Generar archivo fstab:
# genfstab -U -p /mnt >> /mnt/etc/fstab

Obtener UUID de los otros discos:
# lsblk -no UUID /dev/sda3

Editar el fstab generado:
# nano /mnt/etc/fstab

Conectarse a la instalacion
# arch-chroot /mnt /bin/bash

-----------------------------------------------
Configuracion:
-----------------------------------------------

Editar locale:
# nano /etc/locale.gen

Generar locale:
# locale-gen

Establer lenguaje generado:
# echo LANG=es_AR.UTF-8 > /etc/locale.conf
# export LANG=es_AR.UTF-8

Configurar vconsole:

# nano /etc/vconsole.conf
KEYMAP=es
FONT=lat9w-16

Configurar zona horaria:
# ln -s /usr/share/zoneinfo/America/Buenos_Aires /etc/localtime

Configurar reloj en modo UTC:
# hwclock --systohc --utc

Configurar nombre de pc:
# echo Drk1 > /etc/hostname

Configurar contraseña de root:
# passwd

Configurar mkinitcpio:
# nano /etc/mkinitcpio.conf
Mover "block" adelante de "autodetect"

Actualizar mkinitcipio:
# mkinitcpio -p linux

Instalar grub:
# pacman -S grub os-prober

# grub-install --recheck /dev/sda --removable

Configurar grub:
# nano /etc/default/grub
agregar  iommu=pt

Actualizar grub:
# grub-mkconfig -o /boot/grub/grub.cfg


Salir de arch-chroot:
# exit

Reiniciar la pc:
# reboot

-----------------------------------------------
 Instalar entorno grafico:
-----------------------------------------------

Instalar xfce:
# pacman -S xfce4 xfce4-goodies xfce4-whiskermenu-plugin lxdm


Activar gestor de inicio
# sudo systemctl enable lxdm


Instalar control de archivos comprimidos
# pacman -S file-roller p7zip zip unzip unrar unace cdrkit lrzip

-----------------------------------------------
Instalar Libre Office:
-----------------------------------------------

Instalar:
# pacman -S libreoffice libreoffice-es abiword


-----------------------------------------------
Instalar otros programas:
-----------------------------------------------

Instalar screenfetch:
# sudo pacman -S screenfetch
nano ~/.bashrc
add the end of the line "screenfetch" or "archey", then save it.

-----------------------------------------------