User:Mdasoh

From Xen
here are my notes:


building xen-4.6.0-rc2:

chroot /l1 /bin/bash
:
mount -t proc none /proc
mount -t devpts none /dev/pts
mount -t sysfs none /sys
mount -t xenfs none /proc/xen
mount /dev/sdc6 /c/e/
cd /c/e/lrg
git --version
git clone -b 4.6.0-rc2 git://xenbits.xen.org/xen.git
mv xen xen-4.6.0-rc2
cd xen-4.6.0-rc2
ncurses difficulty:
#  479  apt-get install libncursesw5-dev
#  484  dpkg -iGREB libncursesw5-dev_6.0+20150810-1_amd64.deb
#  488  dpkg -iGROB libncurses5-dev_6.0+20150810-1_amd64.deb
#  491  less configure
#  492  cat >> n.c
#  493  gcc -o n.elf n.c -lncurses
#  494  ./n.elf
#  495  gcc -v -o n.elf n.c -lncurses
#  496  gcc -o n.elf n.c -lncurses && echo sane
joe configure <-- modified "no" to "yes"
diff -Naur ../xen-snap46-1/xen-145a800/tools/include/xen/event_channel.h tools/include/xen/event_channel.h
cp -a ../xen-snap46-1/xen-145a800/tools/include/xen/event_channel.h tools/include/xen/event_channel.h
joe tools/pygrub/Makefile <-- replaced "ln" with "true"
make distclean
make world
cd tools
./configure
cd ../stubdom
./configure
cd ../docs
./configure
cd ..
#  638  cp -a ../xen-snap46-1/xen-145a800/tools/include/xen/event_channel.h tools/include/xen/event_channel.h
#  640  less tools/include/xen/event_channel.h
joe tools/include/xen/event_channel.h <-- added a ; at the top
make world
ls dist
ls dist/install <-- the root directory on this chroot is going to look pretty messsy...
make install
(exited chroot)
:
cd /
ln -s /l1 /usr/lib/xen/bin
ln -s /l1 /usr/lib/xen/boot
ln -s /l1 /usr/lib/xen/etc
ln -s /l1 /usr/lib/xen/libexec
ln -s l1/block block
ln -s l1/block-common.sh block-common.sh
ln -s l1/xen-hotplug-common.sh xen-hotplug-common.sh
ln -s l1/hotplugpath.sh hotplugpath.sh
ln -s l1/logging.sh logging.sh
ln -s l1/xen-script-common.sh xen-script-common.sh
ln -s l1/locking.sh locking.sh
ln -s l1/qemu-dm qemu-dm
ln -s l1/vif-bridge .
ln -s l1/vif-common.sh .
/*
#pygrub still not running:
less l1/pygrub
python --version
#    8  ls /usr/lib/python2.7/dist-packages/
#    9  ls l1/local/lib/python2.7/dist-packages/
#   10  ln -s /l1/local/lib/python2.7/dist-packages/* /usr/lib/python2.7/dist-packages
#   11  ls --color /usr/lib/python2.7/dist-packages/
mv /usr/lib/python2.7 /usr/lib/python2.7_
mkdir /usr/lib/python2.7
mkdir /usr/lib/python2.7/dist-packages
joe l1/pygrub <-- changed /usr/bin/python to /l1/usr/bin/python2.7
ln -s /l1/local/lib/python2.7/dist-packages/* /usr/lib/python2.7/dist-packages
ln -s /l1/usr/lib/python2.7/dist-packages/* /usr/lib/python2.7/dist-packages
ln -s /l1/usr/lib/python2.7/* /usr/lib/python2.7
l1/pygrub
*/

running xen 4.6.0-rc2:

/xeninit.sh:

/l1.sh
#export LD_LIBRARY_PATH=/l1:/l1/l2/lib/x86_64-linux-gnu:/l1/usr/lib/x86_64-linux-gnu
export LD_LIBRARY_PATH=/l1:/l1/l2/lib/x86_64-linux-gnu:/l1/usr/lib/x86_64-linux-gnu:/l1/usr/lib
cat /xen-loadmods.sh | while read a b; do modprobe $a; done
mount -t xenfs none /proc/xen
modprobe tun
#modprobe vport-gre
#modprobe vport-vxlan
modprobe openvswitch
echo "please activate openvswitch..."
chroot /l1 /bin/bash
/l1/xenstored --pid-file /var/run/xenstored.pid -T /var/log/xen/xenstored-trace.log
/l1/xenconsoled
/l1/xl devd --pidfile=/var/run/xldevd.pid
/l1/xen-init-dom0
cd /dev
MAKEDEV loop8
cd
losetup /dev/loop8 /e/dos5disk_.img
/l1/xl create /l1/etc/xen/dos3.cfg
LD_LIBRARY_PATH=/d/usrlib:/e/_svnc116/usr/lib:/usr/lib/i386-linux-gnu /usr/bin/directvnc 192.168.4.87:0 -shared
#EOF

/l1.sh:
modprobe loop
cp -a /b/dev/loop* /dev/
mount -o loop /e/__1.fs /l1
mount -o loop /e/__2.fs /l1/l2
mount -o loop /e/__3.fs /l1/l3
mount -o loop /e/_11.fs /l1/l11
mount -o loop /e/_12.fs /l1/l12
mount -o loop /e/_13.fs /l1/l13
mount -o loop /e/_14.fs /l1/l14
mount -o loop /e/_15.fs /l1/l15
#EOF

/xen-loadmods.sh:
xen_acpi_processor     16384  0
xen_netback            45056  0
xen_blkback            36864  0
xen_gntalloc           16384  0
xen_gntdev             20480  2
xen_evtchn             16384  1
xenfs                  16384  1
xen_privcmd            16384  7 xenfs
tcp_diag               16384  0
inet_diag              20480  1 tcp_diag
tun #
#EOF

(within chroot /l1):
# dpkg -l | grep openvswitch
ii  openvswitch-brcompat                   1.4.2+git20120612-9.1~deb7u1.1                  amd64        Open vSwitch bridge compatibility support
ii  openvswitch-common                     1.4.2+git20120612-9.1~deb7u1.1                  amd64        Open vSwitch common components
ii  openvswitch-controller                 1.4.2+git20120612-9.1~deb7u1.1                  amd64        Open vSwitch controller implementation
ii  openvswitch-ipsec                      1.4.2+git20120612-9.1~deb7u1.1                  amd64        Open vSwitch GRE-over-IPsec support
ii  openvswitch-pki                        1.4.2+git20120612-9.1~deb7u1.1                  all          Open vSwitch public key infrastructure dependency package
ii  openvswitch-switch                     1.4.2+git20120612-9.1~deb7u1.1                  amd64        Open vSwitch switch implementations
ii  openvswitch-test                       1.4.2+git20120612-9.1~deb7u1.1                  all          Open vSwitch test package
ii  python-openvswitch                     1.4.2+git20120612-9.1~deb7u1.1                  all          Python bindings for Open vSwitch
#EOT

l1/init-vsw.sh:
mount /dev/sdc6 /c/e
mount -t proc none /proc
mount -t sysfs none /sys
/etc/init.d/openvswitch-controller start
/etc/init.d/openvswitch-ipsec start
/etc/init.d/openvswitch-switch start
#EOF

/l1/etc/dos3.cfg: <-- this is a working hvm guest example.
name = "dos3"
firmware_override = "/usr/lib/xen-default/boot/hvmloader"
builder = "hvm"
netmask = '255.255.255.0'
memory = 1024
shadow_memory = 8
disk = [ 'file:/dev/loop8,format=raw,hda,w' ]
boot = "c"
vga="cirrus"
vnc = 1 # use VNC to insall and setup windows after that is done you can disable this
vncpasswd = ''
vnclisten = '127.0.0.1'
vcpus = 1 # number of cpu's to assign
stdvga = 1
serial = 'pty'
usbdevice = 'tablet' # Required for USB mouse
on_reboot = 'restart'
on_crash = 'restart'
#EOF

/l1/etc/xen/guest1.cfg: <-- this is a working pv guest example
name = "guest1"
builder = "generic"
vif = [ 'mac=22:61:34:05:00:01,model=rtl8139,bridge=xenbr0' ]
netmask = '255.255.255.0'
memory = 1024
shadow_memory = 8
disk = [ 'file:/f/linux1_.img,format=raw,hda,w', '/e/super_grub2_disk_hybrid_2.02s3.iso,,hdc,cdrom' ]
boot = "d"
vga="none"
vnc = 1 # use VNC to insall and setup windows after that is done you can disable this
vncpasswd = ''
vnclisten = '192.168.4.87:1'
vcpus = 1 # number of cpu's to assign
stdvga = 1
serial = 'pty'
usbdevice = 'tablet' # Required for USB mouse
on_reboot = 'restart'
on_crash = 'restart'
pci = [ '01:05.00,permissive=1' ]
kernel = "/e/guest1/vmlinuz-3.2.0-4-686-pae"
ramdisk = "/e/guest1/initrd.img-3.2.0-4-686-pae"
extra = "root=/dev/xvda2 swiotlb=force iommu=soft"
#cat l1/xlexample.pvlinux >> /l1/etc/xen/guest1.cfg
#find guest1 | grep vmlinuz >> /l1/etc/xen/guest1.cfg
#find guest1 | grep initrd >> /l1/etc/xen/guest1.cfg
#EOF

/e/guest1 contents:
mount -o loop,offset=1048576 /f/linux1_.img /c
cp -a /c /e/guest1
#   49  mkdir kernel-3.2  <-- the .deb kernel package does not include the matching initrd file, it has to be installed.
#   50  cd kernel-3.2
#dpkg -x ../kernel-image-3.2.0-4-686-pae-di_3.2.68-1+deb7u3_i386.udeb .

chroot /l1 /bin/bash <-- enabled openvswitch

ps waux | grep qemu
less vif-common.sh
zgrep TUN /proc/config.gz
modprobe tun
echo "tun" >> xen-loadmods.sh
cat xen-loadmods.sh <-- still no second column; may not load
l1/xl_ pci-attach guest1 0000:05:00.0
joe /etc/rcS.d/S01xen.sh
chmod -x /etc/rcS.d/S01xen.sh~
cp -a /e/lrg/linux-4.0.1/drivers/video/fbdev/aty/radeonfb.ko /lib/modules/4.0.1/kernel/drivers/video/fbdev
rm /lib/modules/4.0.1/kernel/drivers/video/fbdev/radeonfb.ko
ln -s /matrox5.sh /etc/rcS.d/S02matrox5.sh
mount /dev/sdc1 /f
joe /f/grub/menu.lst
cp -a /e/lrg/xen-4.6.0-rc2/dist/install/xl l1/xl
joe xeninit.sh

running xen-4.6.0-rc2:  (it's this easy now.)

. /xeninit.sh
mount /dev/sdd1 /f
cd /
l1/xl create /l1/etc/xen/guest1.cfg
sync
l1/xl list
l1/xl destroy dos3
LD_LIBRARY_PATH=/d/usrlib:/e/_svnc116/usr/lib:/usr/lib/i386-linux-gnu /usr/bin/directvnc 192.168.4.87:1 -shared
LD_LIBRARY_PATH=/d/usrlib:/e/_svnc116/usr/lib:/usr/lib/i386-linux-gnu /usr/bin/directvnc 127.0.0.1:0 -shared

specific error messages here:

[  103.509731] matroxfb: Legacy BIOS is for C2C2:C2C2, while this device is 102B:0525
[   42.908969] radeon 0000:00:00.0: BAR 6: can't assign [??? 0x00000000 flags 0x0] (bogus alignment)

pci video passthrough still not working:

#/matrox5.sh
#less /matrox5.sh
#ls /lib/modules/4.0.1/kernel/drivers/video/fbdev/matrox/ <-- this should have any fb modules that are not compiled in.
#l1/xl pci-attach guest1 '0000:01:05.0,permissive=1' <-- this is for a pv guest without a pci statement
#l1/xl pci-detach guest1 0000:05:00.0
#l1/xl pci-attach guest1 '0000:05:00.0,permissive=1' <-- testing Matrox G450 passthrough, also no pci config statement here
cp -a /matrox5.sh /var/www/
cd /e
cd lrg/linux-4.0.1/
cd drivers/video/fbdev/matrox
grep "cannot determine mem" *
less matroxfb_base.c
grep mga_ioremap *.h
less matroxfb_base.h
less matroxfb_base.c