Archives de catégorie : Virtualisation

Convertir une image virtuelle VMWARE (vmdk) Windows au format Virtual Box (vdi)

Convertir une image virtuelle VMWARE (vmdk) Windows au format Virtual Box (vdi).

Par défaut, une image VMWare (vmdk) ne peut pas être utilisée telle quelle par VirtualBox.
Il faut effectuer quelques modifications dessus, pour les rendre compatibles.

Continuer la lecture de Convertir une image virtuelle VMWARE (vmdk) Windows au format Virtual Box (vdi)

Note pour xen

Une petite note pour Xen, inutilisable c’est un brouillon publique.

    Network setup

#nano /etc/network/interfaces

auto eth0
iface eth0 inet static
        address 88.191.34.xxx
        netmask 255.255.255.0
        network 88.191.34.0
        broadcast 88.191.34.255
        gateway 88.191.34.1

# ifconfig -a

eth0 Lien encap:Ethernet HWaddr 00:40:63:E7:AC:66
inet adr:88.191.34.xxx Bcast:88.191.34.255 Masque:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:189 errors:0 dropped:0 overruns:0 frame:0
TX packets:115 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:16820 (16.4 KiB) TX bytes:13745 (13.4 KiB)
Interruption:18 Adresse de base:0xfc00

lo Lien encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)

J’ajoute dans /etc/network/interfaces

auto eth0
iface eth0 inet static
address 88.191.34.50
netmask 255.255.255.0
network 88.191.34.0
broadcast 88.191.34.255
gateway 88.191.34.1

auto eth0:0
iface eth0:0 inet static
address 88.191.202.227
netmask 255.255.255.224
network 88.191.202.224
broadcast 88.191.202.255

# /etc/init.d/networking restart

# ifconfig -a

eth0 Lien encap:Ethernet HWaddr 00:40:63:E7:AC:66
inet adr:88.191.34.50 Bcast:88.191.34.255 Masque:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:210 errors:0 dropped:0 overruns:0 frame:0
TX packets:435 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:67357 (65.7 KiB) TX bytes:45173 (44.1 KiB)
Interruption:18 Adresse de base:0xfc00

eth0:0 Lien encap:Ethernet HWaddr 00:40:63:E7:AC:66
inet adr:88.191.202.227 Bcast:88.191.202.255 Masque:255.255.255.224
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interruption:18 Adresse de base:0xfc00

lo Lien encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)

    Xen Setup

Install

///VIEUX : apt-get install xen-linux-system-2.6.18-5-xen-686 xen-tools libc6-xen xen-hypervisor-3.0.3-1-i386-pae xen-linux-system-2.6.18-5-xen-vserver-686 bridge-utils

apt-get install xen-hypervisor-3.0.3-1-i386 xen-ioemu-3.0.3-1 xen-linux-system-2.6.18-4-xen-vserver-686 xen-tools xen-utils-3.0.3-1 xen-utils-common linux-headers-2.6.18-4-xen-686 linux-image-2.6.18-4-xen-vserver-686 linux-image-2.6.18-4-xen-686 linux-image-xen-686 linux-modules-2.6.18-4-xen-vserver-686 linux-modules-2.6.18-4-xen-686

— Suppression de lilo, installation de GRUB

# apt-get remove lilo –purge
# apt-get install grub mdadm

répondre all

— Installation de GRUB sur le MBR

# grub-install /dev/sda

— Création de la configuration GRUB (menu.lst)

# update-grub

reboot

# ifconfig -a

eth0 Lien encap:Ethernet HWaddr 00:40:63:E7:AC:66
inet adr:88.191.34.50 Bcast:88.191.34.255 Masque:255.255.255.0
adr inet6: fe80::240:63ff:fee7:ac66/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:457 errors:0 dropped:0 overruns:0 frame:0
TX packets:186 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:36270 (35.4 KiB) TX bytes:20743 (20.2 KiB)
Interruption:16 Adresse de base:0xfc00

eth0:0 Lien encap:Ethernet HWaddr 00:40:63:E7:AC:66
inet adr:88.191.202.227 Bcast:88.191.202.255 Masque:255.255.255.224
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interruption:16 Adresse de base:0xfc00

lo Lien encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
adr inet6: ::1/128 Scope:Hôte
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)

sit0 Lien encap:IPv6-dans-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

# /etc/xen/scripts/network-bridge status

============================================================

2: eth0: mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:40:63:e7:ac:66 brd ff:ff:ff:ff:ff:ff
inet 88.191.34.50/24 brd 88.191.34.255 scope global eth0
inet 88.191.202.227/27 brd 88.191.202.255 scope global eth0:0
inet6 fe80::240:63ff:fee7:ac66/64 scope link
valid_lft forever preferred_lft forever
Device « xenbr0 » does not exist.

# xen-create-image –dir /home/xen –hostname tutu –debootstrap –dist etch –boot

# nano /etc/xen-tools/xen-tools.conf

kernel = /boot/vmlinuz-2.6.18-4-xen-686
initrd = /boot/initrd.img-2.6.18-4-xen-686

# xen-delete-image
# xen-list-images

    WINDOWS

2.6.18-5-xen-686

title Xen 3.0.3-1-i386-pae / Debian GNU/Linux, kernel 2.6.18-5-xen-686
root (hd0,0)
kernel /xen-3.0.3-1-i386-pae.gz
module /vmlinuz-2.6.18-5-xen-686 root=/dev/md2 ro console=tty0
module /initrd.img-2.6.18-5-xen-686
savedefault

1 / creer un fichier pour contenir le guest

# dd if=/dev/zero of=/var/xenvm/winxp.img bs=1024k count=4000

2 / decommenter le vif-nat dans /etc/xen/xend-config.sxp

3 / Activé le pool

#nano /etc/modules.conf
#options loop max_loop=64
#rmmod loop
# modprobe loop

4 / Config

import os, re
arch = os.uname()[4]
if re.search('64', arch):
    arch_libdir = 'lib64'
else:
    arch_libdir = 'lib'
kernel = '/usr/lib/xen-3.0.3-1/boot/hvmloader'
builder='hvm'
memory = 512
shadow_memory = 100
name = 'WinXP'
vcpus=1
#vif = [ 'type=ioemu, mac=00:16:3e:FF:FE:05, bridge=xenbr0 ']
#vif = [ 'ip=192.168.1.130, type=ioemu, model=ne2k_pci' ]
vif = [ 'ip=192.168.1.130' ]
disk = [ 'file:/var/xenvm/winxp.img,ioemu:hda,w','file:/var/xenvm/IMAGES/WINXPVL.ISO,hdc:cdrom,r' ]
device_model = '/usr/lib/xen-3.0.3-1/bin/qemu-dm'
boot="d"
vnc=1
vncviewer=1
vncdisplay=3
vncunused=0
vncpasswd=''
nographic=0
localtime=1
usb=1
usbdevice='mouse'
keymap='us'
ne2000=1
    OVH

# echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter
# /etc/init.d/networking restart
# xm create /home/xen/winxp.cfg

source

http://www.howtoforge.com/debian_etch_xen_3.1

VMServer pour dedibox et superplan

Un brouillon publique de l’installation de VMServer 1

    1 / Kernel

debian etch :

# apt-get install bzip2 make gcc binutils-doc gcc-4.1-locales libc6-dev-amd64 lib64gcc1 lib64ssp0 cpp-2.95-doc manpages-dev autoconf automake1.9 libtool flex bison gdb glibc-doc ncurses-bin libncurses5-dev zip unzip arj mc libglib2.0-data autoconf2.13 automake1.4 binutils cpp fetchmail flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.3-dev libpcre3 libpopt-dev linux-kernel-headers lynx m4 make ncftp nmap perl perl-modules unzip zip zlib1g-dev autoconf automake1.9 libtool bison autotools-dev g++ vim lm-sensors smartmontools debhelper modutils kernel-package libncurses5-dev fakeroot screen

debian etch :

#apt-get install g++ libx11-6 libx11-dev x-window-system-core x-window-system xspecs libxtst6 module-init-tools libice6 libxrender1 libxt6 libxi6

debian sarge :

apt-get install bzip2 make gcc binutils-doc lib64gcc1 cpp-2.95-doc manpages-dev autoconf automake1.9 libtool flex bison gdb glibc-doc ncurses-bin libncurses5-dev zip unzip arj mc libglib2.0-data autoconf2.13 automake1.4 binutils cpp fetchmail flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.3-dev libpcre3 libpopt-dev linux-kernel-headers lynx m4 make ncftp nmap perl perl-modules unzip zip zlib1g-dev autoconf automake1.9 libtool bison autotools-dev g++ vim lm-sensors smartmontools debhelper modutils kernel-package libncurses5-dev fakeroot screen

debian sarge :

#apt-get install g++ libx11-6 libx11-dev x-window-system-core x-window-system xspecs libxtst6 module-init-tools libice6 libxrender1 libxt6 libxi6

ubuntu dapper :

# apt-get install bzip2 make gcc binutils-doc gcc-4.0-locales libc6-dev-amd64 lib64gcc1 cpp-2.95-doc manpages-dev autoconf automake1.9 libtool flex bison gdb glibc-doc ncurses-bin libncurses5-dev zip unzip arj mc libglib2.0-data autoconf2.13 automake1.4 binutils cpp fetchmail flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.3-dev libpcre3 libpopt-dev linux-kernel-headers lynx m4 make ncftp nmap perl perl-modules unzip zip zlib1g-dev autoconf automake1.9 libtool bison autotools-dev g++ vim lm-sensors smartmontools debhelper modutils kernel-package libncurses5-dev fakeroot screen

ubuntu dapper :

#apt-get install g++ libx11-6 libx11-dev libxtst6 module-init-tools libice6 libxrender1 libxt6 libxi6

Ajouter les headers ou recompiler le kernel avec les modules activé.

    Dedibox

#mkdir kernel
#cd kernel
#wget ftp://ftp.dedibox.fr/pub/dedibox/kernel/r7/src/src-dedibox-r7-beta1.tar.gz
#tar zxvf src-dedibox-r7-beta1.tar.gz
#cd linux-2.6.20.6/
#wget ftp://ftp.dedibox.fr/pub/dedibox/kernel/r7/src/config-dedibox-r7.txt

    kimsufi

#mkdir kernel
#cd kernel
#wget ftp://ftp.free.fr/pub/linux/kernel/v2.6/linux-2.6.20.3.tar.bz2
#tar jxvf linux-2.6.20.3.tar.bz2
#cd linux-2.6.20.3/
#wget http://www.artiflo.org/Kernel/OVH/Superplan2007/2.6.20.3-artiflo-core2duo.conf

    Compilation

#make clean
#make-dpkg clean
#make menuconfig
« Load an Alternate Configuration File » > config-dedibox-r7.txt
#make bzImage
#make modules
#make modules_install
#make install

# cp arch/i386/boot/bzImage /boot/bzImage-2.6.20.3-core2duo-artiflo-v2
# cp -R linux-2.6.20.6/ /usr/src/linux-2.6.20.6

# nano /boot/grub/menu.lst

title           Ubuntu, kernel 2.6.20.6
root            (hd0,0)
kernel          /vmlinuz root=/dev/sda2 ro quiet splash
savedefault
boot

#nano /etc/lilo.conf
#/sbin/lilo

    2 / Install VMWARE server

#mkdir /var/vm
#mkdir vmware
#cd vmware
#wget http://download3.vmware.com/software/vmserver/VMware-server-1.0.4-56528.tar.gz

#tar zxvf VMware-server-1.0.4-56528.tar.gz

#cd vmware-server-distrib
#./vmware-install.pl

#/usr/src/linux-2.6.20.6/include/

    3 / Install patch VMWARE server

# http://knihovny.cvut.cz/ftp/pub/vmware/
# cd ..
# cd ..
#wget http://www.artiflo.org/VMSERVER/vmware-any-any-update113.tar.gz

#tar -zxvf vmware-any-any-update113.tar.gz
#cd vmware-any-any-update113
#./runme.pl

Récupérer les clés gratuite sur le site de vmware server.

4 / Install VMWARE MUI

# cd ..
#wget http://download3.vmware.com/software/vmserver/VMware-mui-1.0.4-56528.tar.gz
#tar -zxvf VMware-mui-1.0.4-56528.tar.gz
#cd vmware-mui-distrib

#./vmware-install.pl

Vous pouvez tester

https://88.191.34.xxx:8333

    5 / NAT

# nano /etc/vmware/vmnet8/nat/nat.conf

[incomingtcp]
3389 = 192.168.225.128:3389

/usr/lib/vmware/net-services.sh restart

    6 / Source

http://wattazoum.fr/spip.php?article57

http://bilfous.free.fr/Datas/vmware-any-any-update108.tar.gz

http://www.howtoforge.com/debian_sarge_vmware_server_howto

/sbin/killall5

Do you want to be able to use host-only networking in your virtual machines?
[yes] no

    TROUBLESHOOT :
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libpng12.so.0/libpng12.so.0: no version information available (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)

#cd /usr/lib/vmware/lib/libgcc_s.so.1/
#sudo mv libgcc_s.so.1 libgcc_s.so.1.bkp
#sudo ln -s /lib/libgcc_s.so.1 .
#sudo ldconfig

Dec 5 03:00:24 geronimo vmware-authd[11426]: PAM unable to dlopen(/lib/security/pam_unix2.so)
Dec 5 03:00:24 geronimo vmware-authd[11426]: PAM [dlerror: /lib/security/pam_unix2.so: cannot open shared object file: No such file or directory]
Dec 5 03:00:24 geronimo vmware-authd[11426]: PAM adding faulty module: /lib/security/pam_unix2.so

#auth sufficient /lib/security/pam_unix2.so shadow nullok
#auth required /lib/security/pam_unix_auth.so shadow nullok
#account sufficient /lib/security/pam_unix2.so
#account required /lib/security/pam_unix_acct.so

https://bugs.launchpad.net/ubuntu/+bug/112937

hammer ~ # cat /etc/pam.d/vmware-authd
#%PAM-1.0
auth sufficient pam_unix.so shadow nullok
auth required pam_unix_auth.so shadow nullok
account sufficient pam_unix.so
account required pam_unix_acct.so

/etc/pam.d/vmware-authd

#%PAM-1.0

@include common-auth
@include common-account

Xen et etch

Toujours dans la série des articles sur la virtualisation en version brut de décoffrage. C’est inutilisable, c’est un brouillon publique.

aliasing IP

    Install Xen

# apt-get install xen-linux-system-2.6.18-4-xen-686 xen-tools libc6-xen xen-hypervisor-3.0.3-1-i386-pae xen-linux-system-2.6.18-4-xen-vserver-686 bridge-utils

# reboot

# mkdir /home/xen

    Setup

#nano /etc/xen-tools/xen-tools.conf

dir = /home/xen
dist   = etch
mirror = http://mirror.ovh.net/ftp.debian.org/debian
    Setup DomU

# xen-create-image –dir /home/xen –hostname tutu –ip 88.191.202.xxx –gateway 88.191.202.www –netmask 255.255.255.224 –debootstrap –dist etch –boot

ou

# xen-create-image –dir /home/xen –hostname srv2 –ip 88.191.34.sss –gateway 88.191.34.1 –netmask 255.255.255.0 –debootstrap –dist etch –boot

# nano /etc/xen-tools/xen-tools.conf

kernel = /boot/vmlinuz-2.6.18-4-xen-686
initrd = /boot/initrd.img-2.6.18-4-xen-686

# xen-delete-image
# xen-list-images

IP supplémentaire

inet adr:88.191.34.xxx Bcast:88.191.34.255 Masque:255.255.255.0
dhcp : 88.191.34.85

# xen-create-image –dir /home/xen –hostname tutu –ip 88.191.54.89 –gateway 88.191.54.87 –netmask 255.255.255.0 –debootstrap –dist etch –boot

    Source

https://wiki.alio.fr/doku.php?id=fr:informatique:quickref:xen

http://www.debian-administration.org/articles/396

http://tcweb.org/mediawiki/index.php/Xen_dedibox

http://www.howtoforge.com/debian_etch_xen_from_debian_repository

http://www.howtoforge.com/debian_etch_xen_3.1

http://www.punknix.com/?q=virtualization_xen