Le blog de Jean David TECHER, un Réunionnais à Saint-Priest/Lyon

Aller au contenu | Aller au menu | Aller à la recherche


< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 >

dimanche 25 décembre 2011

Xen 4.2 unstable: Xen PVHVM on Linux HVM + VGA Pass Through (NVIDIA): it works for Linux 3.1.6 !

I asked myself if it could be possible to use
  • Xen VGA Pass Through for NVIDIA
  • Xen PVHVM
on a Linhx HVM domU.

The answer is yes! I went on [1]. I was a little confused by the idea that it could very easy to do.

I spent a lof of time trying to resolve several issues (...) But all issues are fixed now .

Here the assumption is done that we've already have a fresh domU running on Ubuntu Lucid 10.4.3 and Xen VGA Pass Through (for more info about VGA Pass Through refer to my previous article)

1. When everything is OK, we've got...

Refer to [1], we have

Xen PV HVM on domU (HVM) Ubuntu Lucid 10.4.3: VGA Pass Through is working too
root@mercury-xen01:~# dmesg | egrep -i 'xen|blk'
[    0.000000] Linux version 3.1.6 (root@mercury-xen01) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #1 SMP Sun Dec 25 01:26:07 CET 2011
[    0.000000] DMI: Xen HVM domU, BIOS 4.2-unstable 12/22/2011
[    0.000000] Hypervisor detected: Xen HVM
[    0.000000] Xen version 4.2.
[    0.000000] Xen Platform PCI: I/O protocol version 1
[    0.000000] Netfront and the Xen platform PCI driver have been compiled for this kernel: unplug emulated NICs.
[    0.000000] Blkfront and the Xen platform PCI driver have been compiled for this kernel: unplug emulated disks.
[    0.000000] ACPI: RSDP 00000000000ea020 00024 (v02    Xen)
[    0.000000] ACPI: XSDT 00000000fc00f680 00054 (v01    Xen      HVM 00000000 HVML 00000000)
[    0.000000] ACPI: FACP 00000000fc00f340 000F4 (v04    Xen      HVM 00000000 HVML 00000000)
[    0.000000] ACPI: DSDT 00000000fc003600 0BCBC (v02    Xen      HVM 00000000 INTL 20100528)
[    0.000000] ACPI: APIC 00000000fc00f440 000D8 (v02    Xen      HVM 00000000 HVML 00000000)
[    0.000000] ACPI: HPET 00000000fc00f590 00038 (v01    Xen      HVM 00000000 HVML 00000000)
[    0.000000] ACPI: WAET 00000000fc00f5d0 00028 (v01    Xen      HVM 00000000 HVML 00000000)
[    0.000000] ACPI: SSDT 00000000fc00f600 00031 (v02    Xen      HVM 00000000 INTL 20100528)
[    0.000000] ACPI: SSDT 00000000fc00f640 00031 (v02    Xen      HVM 00000000 INTL 20100528)
[    0.000000] Booting paravirtualized kernel on Xen HVM
[    0.000000] Xen HVM callback vector for event delivery is enabled
[    0.135090] Xen: using vcpuop timer interface
[    0.135094] installing Xen timer for CPU 0
[    0.300043] installing Xen timer for CPU 1
[    0.470043] installing Xen timer for CPU 2
[    0.640040] installing Xen timer for CPU 3
[    1.031644] xen/balloon: Initialising balloon driver.
[    1.031654] xen-balloon: Initialising balloon driver.
[    1.050023] Switching to clocksource xen
[    1.051618] xen: --> pirq=19 -> irq=8 (gsi=8)
[    1.051659] xen: --> pirq=20 -> irq=12 (gsi=12)
[    1.051689] xen: --> pirq=21 -> irq=1 (gsi=1)
[    1.051720] xen: --> pirq=22 -> irq=6 (gsi=6)
[    1.051753] xen: --> pirq=23 -> irq=4 (gsi=4)
[    1.051791] xen: --> pirq=54 -> irq=7 (gsi=7)
[    2.061962] QLogic/NetXen Network Driver v4.0.76
[    2.062183] xen: --> pirq=17 -> irq=17 (gsi=17)
[    2.090348] xen: --> pirq=18 -> irq=21 (gsi=21)
[    2.260133] xen: --> pirq=53 -> irq=28 (gsi=28)
[    2.260136] xen-platform-pci 0000:00:03.0: PCI INT A -> GSI 28 (level, low) -> IRQ 28
[    2.266953] input: Xen Virtual Keyboard as /devices/virtual/input/input3
[    2.267012] input: Xen Virtual Pointer as /devices/virtual/input/input4
[    2.269131] Initialising Xen virtual ethernet driver.
[    2.281965] blkfront: xvda: flush diskcache: enabled
[    2.282796] vbd vbd-51744: 19 xenbus_dev_probe on device/vbd/51744
[    2.283048] vbd vbd-51744: failed to write error node for device/vbd/51744 (19 xenbus_dev_probe on device/vbd/51744)
[    7.515418] xen: --> pirq=55 -> irq=44 (gsi=44)
[    8.328334] xen: --> pirq=52 -> irq=40 (gsi=40)
[    8.488638] xen: --> pirq=51 -> irq=36 (gsi=36)

Source

2. domU: Kernel 3.1.6

  1. Download the sources
    wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.1.6.tar.bz2
    tar xjf linux-3.1.6.tar.bz2
    cd linux-3.1.6
  2. Prepare the configuration
    make menuconfig
    The most important is to be sure to have the same following configuration. Be sure to have CONFIG_XEN_PLATFORM_PCI compile as a module (=m).
    root@mercury-xen01:/usr/src/linux-3.1.6# grep -i xen .config
    CONFIG_XEN=y
    CONFIG_XEN_DOM0=y
    CONFIG_XEN_PRIVILEGED_GUEST=y
    CONFIG_XEN_PVHVM=y
    CONFIG_XEN_MAX_DOMAIN_MEMORY=128
    CONFIG_XEN_SAVE_RESTORE=y
    CONFIG_XEN_DEBUG_FS=y
    CONFIG_XEN_DEBUG=y
    CONFIG_PCI_XEN=y
    CONFIG_XEN_PCIDEV_FRONTEND=m
    CONFIG_XEN_BLKDEV_FRONTEND=m
    # CONFIG_XEN_BLKDEV_BACKEND is not set
    CONFIG_NETXEN_NIC=y
    CONFIG_XEN_NETDEV_FRONTEND=m
    CONFIG_XEN_NETDEV_BACKEND=m
    CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
    CONFIG_HVC_XEN=y
    # CONFIG_XEN_WDT is not set
    CONFIG_XEN_FBDEV_FRONTEND=y
    # Xen driver support
    CONFIG_XEN_BALLOON=y
    CONFIG_XEN_SCRUB_PAGES=y
    CONFIG_XEN_DEV_EVTCHN=y
    CONFIG_XEN_BACKEND=y
    CONFIG_XENFS=y
    CONFIG_XEN_COMPAT_XENFS=y
    CONFIG_XEN_SYS_HYPERVISOR=y
    CONFIG_XEN_XENBUS_FRONTEND=y
    CONFIG_XEN_GNTDEV=m
    CONFIG_XEN_GRANT_DEV_ALLOC=m
    CONFIG_XEN_PLATFORM_PCI=m
    CONFIG_SWIOTLB_XEN=y
    CONFIG_XEN_PCIDEV_BACKEND=m
    
    Notice: you can download my own configuration here
  3. Build and install
    make -j4 bzImage modules
    make install modules_install
  4. Change the content of file /etc/initramfs-tools/modules
    root@mercury-xen01:~# cat /etc/initramfs-tools/modules 
    # List of modules that you want to include in your initramfs.
    #
    # Syntax:  module_name [args ...]
    #
    # You must run update-initramfs(8) to effect this change.
    #
    # Examples:
    #
    # raid1
    # sd_mod
    xen-platform-pci
    xen-blkfront
    xen-netfront
    
  5. Build initrd
    mkinitramfs -o /boot/initrd.img-3.1.6 3.1.6
    

3. domU: Grub

  1. Change grub options in /etc/default/grub
    root@mercury-xen01:~# cat /etc/default/grub 
    # If you change this file, run 'update-grub' afterwards to update
    # /boot/grub/grub.cfg.
    
    GRUB_DEFAULT=0
    GRUB_HIDDEN_TIMEOUT=0
    GRUB_HIDDEN_TIMEOUT_QUIET=true
    GRUB_TIMEOUT=120
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT="loglevel=9 rootdelay=120 quiet splash"
    GRUB_CMDLINE_LINUX=""
    
    # Uncomment to disable graphical terminal (grub-pc only)
    #GRUB_TERMINAL=console
    
    # The resolution used on graphical terminal
    # note that you can use only modes which your graphic card supports via VBE
    # you can see them in real GRUB with the command `vbeinfo'
    #GRUB_GFXMODE=640x480
    
    # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
    GRUB_DISABLE_LINUX_UUID=true
    
    # Uncomment to disable generation of recovery mode menu entries
    #GRUB_DISABLE_LINUX_RECOVERY="true"
    
    # Uncomment to get a beep at grub start
    #GRUB_INIT_TUNE="480 440 1"
    
  2. Update grub
    root@mercury-xen01:~# update-grub
    Generating grub.cfg ...
    Found linux image: /boot/vmlinuz-3.1.6
    Found initrd image: /boot/initrd.img-3.1.6
    ....
    
  3. Edit /boot/grub/grub.cfg. We need to replace the line root=/dev/sda1 by root=/dev/xvda1
    ...
    ....
    ### BEGIN /etc/grub.d/10_linux ###
    menuentry 'Ubuntu, avec Linux 3.1.6' --class ubuntu --class gnu-linux --class gnu --class os {
            recordfail
            insmod ext2
            set root='(hd0,1)'
            search --no-floppy --fs-uuid --set b199c136-7ea3-4244-b51a-9adfd52ea892
            linux   /boot/vmlinuz-3.1.6 root=/dev/xvda1 ro   loglevel=9 rootdelay=120 quiet splash
            initrd  /boot/initrd.img-3.1.6
    }
    
  4. Shutdown the domU

4. dom0: domU configuration

  1. For the first boot (*) You need to change every hdX to xvdX. For example, here the content of my configuration file
    root@mercury:~# grep -vE '^(#|$)' /etc/xen/machines/mercury-xen01.cfg 
    builder='hvm'
    shadow_memory = 128
    name = "mercury-xen01"
    memory      = '3072'
    vcpus = '4'
    disk        = [
                      'phy:/dev/xenvg/mercury-xen01-disk-1,xvda,w',
    		   'file:/opt/Xen/CD_DVD/Quake_III_Arena.iso,xvdc:cdrom,r',
                  ]
    boot="cd"
    name        = 'mercury-xen01'
    vif         = [ 'mac=00:16:3E:B7:05:58,bridge=eth0,model=e1000' ]
    on_poweroff = 'destroy'
    on_reboot   = 'restart'
    on_crash    = 'restart'
    sdl=0
    vnc=1
    vnclisten="0.0.0.0"
    vncconsole=1
    vncpasswd=''
    gfx_passthru=1
    pci  = [ '01:00.0','00:1a.0','00:1d.0' ]
    acpi=1
    apic=1
    xen_extended_power_mgmt=1
    pae=1
    arch='x86_64'
    hpet = 1
    hap = 1
    monitor=1
    serial='pty'
    keymap='fr'
    soundhw = "all"
    audio="on"
    xen_platform_pci=1
    
    (*) For a unknown reason , after several reboots, you can put hd[a-] instead of xvd[a-d]
  2. Restart the domU
  3. Reinstall NVIDIA driver for the new kernel

5 Last fix: Automount CDROM device

When googling a lot, I found this url http://www.ossramblings.com/automount-cdrom-ubuntu-lucid-maverick then I did
apt-get remove --purge hal
apt-get install hal
apt-get install halevt
gnome-volume-manager is not available on Ubuntu Lucid 10.4.3 so I replace it by halevt

samedi 24 décembre 2011

2012: Call of the dragon from the dark side...

Tonight it's Christmas! As far as I remembered while I was listening Relax - done by Mika -, my mind went out(...) To my family, to my friends, I was thinking a couple hours ago! At 06:00 PM, I went to the church - not away from where I live -. I dedicated a prayer to my famlily and my friends. I called my family (Reunion Island) in Indian Ocean. I was very glad to listen my mother and my sister on phone. Dad was a little tired. Happy I was to call with him :) even if I was not with them.

Last night and tonight, I called my friends for Christmas. I was happy to have one of my friends - on phone -. I was a little stressed about what happened to her. For each Chritsmas, knowing that person I know thinks about you is all I need.

For the 4 pasted years, several chapters of my life were done

  • 2007: Dragon down
  • Feb 2008/ July 2009: Dragon Reborn
  • September 2009/ June 2011: Dragon Reloaded
  • July 2011/December 2011: Dragon came back...
2012 will be the call of the dragon. Dark side is like the black background that you can see in the image on the left on this article. Foreground: you see the beauty of Jana Defi. Background: it's up to you. I love this image. I put in on my mug at job. It's my angel whereas I am a dragon.

2011 was a very surprising year. Well it was a very good year. Hope for 2012

mercredi 21 décembre 2011

Supprimer la chaine "<U+FEFF>", BOM

En faisant un less sur un fichier, cette chaîne apparaît en début de fichier
<U+FEFF>..... ......
........ ......... .........
Pour la supprimer
sed -i '1 s:\xEF\xBB\xBF::' file
Source: http://thegreyblog.blogspot.com/2010/09/shell-script-to-find-and-remove-bom.html

vendredi 16 décembre 2011

Semaine bien stressante

Je n'avais pas connu une semaine aussi stressante au niveau professionnel depuis bien des lustres. J'ai réussi à dormir avec peu de calme ces derniers jours. Au réveil, l'esprit tourné vers le travail en espérant que tout aille pour le mieux pour la journée. Ma dernière montée de stress - au niveau professionel - doit remonter au printemps 2010 quand j'ai virtualisé pour la première fois des serveurs Oracle. Je m'en rappelle encore. Je n'avais pas réussi à l'époque à en dormir la veille...

Quelques période de doute passager, des étourderies de débutant...mais bon au moins on tout ira pour le mieux!

Ce soir annonce le week-end! Au programme: du repos que du repos et quelques occupations, histoire de se changer les idées comme il faut!