BannerFans.com

QEMU

FALLA KVM EN QEMU, SOLO INICIA CON ROOT

sudo nano /etc/modprobe.d/kvm_intel.conf
options kvm_intel nested=1

sudo usermod -aG kvm usuario
sudo usermod -aG libvirt usuario

sudo nano /etc/libvirt/qemu.conf
group = "kvm"

Comando para lanzarlo:
export PULSE_LATENCY_MSEC=30
qemu-system-x86_64  -enable-kvm -m 400  -soundhw ac97 -drive file='/home/mando/Distribuciones/Android/Android51',format=raw

RESUMEN DEBIAN HURD


wget http://ftp.debian-ports.org/debian-cd/hurd-i386/debian-hurd-2015/debian-hurd-20150424.img.tar.gz

tar xzf debian-hurd*img.tar.gz

qemu-system-i386 -m 1G -drive file=$(echo debian-hurd-*.img),cache=writeback


EMULADORES DE ANDROID EN LINUX



QEMU


1) Instala Qemu:


sudo pacman -S qemu


2) Especifica el audio para qemu


sudo pacman -S alsa-utils alsa-plugins alsa-oss


export PULSE_LATENCY_MSEC=30


Innecesario:


export QEMU_AUDIO_DRV=alsa


alsactl init


3) Descarga de aquí Android 5.1


http://www.android-x86.org/download


4) Comprueba que el pc tiene aceleración para vitualizar, o kvm, si da 1 o más si la tiene y las diferentes opciones de sonido.


egrep -c "(svm|vmx)" /proc/cpuinfo


qemu-system-x86_64 -soundhw help



5) Crea una carpeta llamada Android, pega Android 5.1, abre un terminal dentro y escribe:


Para crear el disco duro virtual:


qemu-img create -f raw Android51 6G


Para instalar el sistema en el mismo:


qemu-system-i386 -m 500M -hda Android51 -enable-kvm -soundhw ac97 -k es  -cdrom '/home/tu-usuario/Distribuciones/Android/android-x86-5.1-rc1.iso





7) Durante la instalación dale a create modify partition, te saltará cfdisk, crea una partición con New y márcala como boot, guarda con yes y salte.


Después te preguntará si quieres formato gpt, dile que no,  pon ext3, y al grub efi dile no.  


8) Por último crea un lanzador con .desktop:


[Desktop Entry]

Exec=/home/tu-usuario/Dirección/Android/Android51.sh

Type=Application

Name=Android

Icon=/home/usuario/Dirección/android.png

Y ahora crea Android51.sh y hazle un chmod +x

export PULSE_LATENCY_MSEC=30
qemu-system-x86_64  -enable-kvm -m 400 -soundhw ac97 -drive file='/home/usuario/Distribuciones/Android/Android51',format=raw

Y si quieres que te salga en tu menú, añadelo a .local/Share/applications


8) Para hacer pruebas, Métele uno de estos scripts de bash a la carpeta, ponle un nombre acabado en .sh y dale permisos de ejecución con chmod +x y haz doble click sobre el, previo, configura nautilus o tu navegador de carpetas para abrir textos como programas :



#!/bin/bash
qemu-system-x86_64  -enable-kvm -m 500 -drive file=Android51,format=raw


O también, si desaparece el ratón:

#!/bin/bash
qemu-system-x86_64  -enable-kvm -cpu host -show-cursor -k es -m 500 -drive file=Android51,format=raw


O también con sonido Realtec RTL8111/8168/8411


#!/bin/bash
qemu-system-x86_64 -enable-kvm -soundhw ac97 -k es -m 500 -drive file=Android51,format=raw


O también, para redimensionar qemu con el ratón:


#!/bin/bash
qemu-system-x86_64 -machine smm=off -display sdl,frame=off,window_close=off -enable-kvm -soundhw ac97 -k es -m 500 -drive file=Android51,format=raw


O también, para redimensionar qemu con el ratón:


#!/bin/bash
qemu-system-i386 -display sdl,frame=off,window_close=off -boot order=cd -enable-kvm -soundhw ac97 -k es -m 500 -drive file=Android51,format=raw


O también, para redimensionar qemu con el ratón:


#!/bin/bash
qemu-system-x86_64 -display sdl,frame=off,window_close=off -enable-kvm -soundhw ac97 -k es -m 500 -drive file=Android51,format=raw


O también, si falla el sonido:


#!/bin/bash
qemu-system-x86_64 -enable-kvm -soundhw all -k es -m 500 -drive file=Android51,format=raw


O también, ¿boot?:

#!/bin/bash
qemu-system-x86_64  -boot order=c -enable-kvm -soundhw ac97 -k es -m 500 -drive file=Android51,format=raw



O también cargar sin instalar con compartir carpeta:

#!/bin/bash
qemu-system-i386  -enable-kvm -soundhw ac97 -m 500 -drive file=Android51,format=raw -device usb-ehci,id=usb,bus=pci.0,addr=0x4 -device usb-host,hostbus=3,hostaddr=4


O también cargar sin instalar con compartir carpeta:

#!/bin/bash
qemu-system-i386 -m 1G -hda Android51 -enable-kvm -soundhw ac97 -k es -net user,smb=/home/tu-usuario/Distribuciones/Android/Samba  -cdrom '/home/tu-usuario
/Distribuciones/Android/android-x86-5.1-rc1.iso'


O también, activar usb:

#!/bin/bash
qemu-system-i386  -enable-kvm -m 500 -soundhw ac97 -drive file=Android51,format=raw -device usb-ehci,id=usb,bus=pci.0,addr=0x4 -device usb-host


O también, para el micro y compartir carpeta:


qemu-system-x86_64  -enable-kvm -m 500 -localtime -soundhw  ac97 -net nic,model=virtio  -net user,smb=/home/estrellita/Distribuciones/Android/Linux -drive file='/home/estrellita/Distribuciones/Android/Android51',format=raw 



8) Configura Android para Qemu:


Zona horaria Bruselas


No actives tu cuenta de google.

Dale a Ajustes, Seguridad, Orígenes desconocidos.
Dale a Ajustes, Apps compatibility, Enable Native Bridge
 
Instala aptoide LITE
 
Estas son las aplicaciones:
 
1) Whatsapp
 
2)   ve Ajustes, Pantalla, Savapantallas. y Suspender despues de 30 minutos. y o instala NEVER SLEEP

3) Autostart-No root: desactiva, "Go to Home screen after autostart" y añáde solo el Whatsapp y never slepp
 
4) VLC for Android Beta

5) Termux va bien como emulador de terminal 


6) Para desinstalar programas: -Ajustes -Aplicaciones

7) Para desinstalar programas del sistema instala System / App / Mover

Instrucciones para usar Android 5.1: 

Para que funcione quitar aplicaciones dejar el cursor pegado a la misma sin moverlo.

Para descargar imágenes mantener pulsado el dedo en la imagen, cuando se haga grande.

Para copiar palabras mantener pulsado el dedo en la frase.

Las aplicaciones se guardan en

sdcard/Android/data 

data/user/0

Para entrar en las carpetas root, escribir,

su 
pm install nombre.apk.

Instrucciones Qemu:

Para maximizar y minizar pulsa, pulsa Control+Alt+ - o

Para sacar el ratón de Qemu pulsa Control+Alt+ G

Pantalla completa Ctrl+Alt+F

Si el sonido falla, es porque activaste la cuenta de google. Detener y pulsar play de nuevo.


En Whatsapp:

Para eliminar contacto pulsar en el, puntitos, Ver contacto, puntitos, Editar,  Papelera

Para agregar personas muñequito arriba derecha


Para volver al menu principal pinchar  y arrastrar a la derecha


Cambiar foto de fondo Ajustes, Perfil, Cámara de fotos.

Para ocultar ventanas pulsa Esc

Para enviar imágenes ir a downloads y marcar la foto en cuestión. Después darle a enviar Whatsapp


9) También puedes descargar whatsapp de esta dirección.


www.apkmirror.com/apk/whatsapp-inc/whatsapp

http://www.apkmirror.com/wp-content/themes/APKMirror/download.php?id=112166

http://www.apkmirror.com/apk/whatsapp-inc/whatsapp/whatsapp-2-16-244-release/whatsapp-messenger-2-16-244-android-apk-download/#file



10) Intentos infructuosos de compartir carpeta:


sudo pacman -S samba


sudo cp  /etc/samba/smb.conf.default /etc/samba/smb.conf


sudo nano /etc/samba/smb.conf


[homes]
   comment = /home/tu-usuario/Distribuciones/Android/Linux
   browseable = no
   writable = yes
   valid users = %S

[global]
  usershare path = /var/lib/samba/usershare
  usershare max shares = 100
  usershare allow guests = yes
  usershare owner only = yes


sudo  mkdir -p /var/lib/samba/usershare


sudo groupadd -r sambashare


sudo chown root:sambashare /var/lib/samba/usershare


sudo chmod 1770 /var/lib/samba/usershare


sudo gpasswd sambashare -a tu-usuario


sudo smbpasswd -a tu-usuario


sudo systemctl enable smbd.service smbd.socket



qemu-system-x86_64  -enable-kvm -m 500 -localtime -soundhw  ac97 -net nic,model=virtio  -net user,smb=/home/tu-usuario/Distribuciones/Android/Linux -drive file='/home/tu-usuario/Distribuciones/Android/Android51',format=raw 


Luego habilita samba con Servers Ultimate y Servers Ultimate Pack B en Android.


http://www.adslzone.net/moviles/android/como-crear-un-servidor-samba-en-android/


*) Para habilitar compartir carpetas o la cam he usado estos enlaces, por ahora no lo he conseguido:


https://www.suse.com/documentation/sles11/book_kvm/data/cha_qemu_guest_inst_qemu-img.html


http://www.elandroidelibre.com/2011/02/de-android-al-ordenador-y-vicersersa-%C2%A1-sin-cables.html


https://bbs.archlinux.org/viewtopic.php?id=202606


http://www.gpltarragona.org/archives/368


http://blog.desdelinux.net/instalar-y-configurar-qemu-kvm-en-arch-linux/


http://www.taringa.net/comunidades/unixx/5686747/Tutorial-Qemu-para-novatos.html


https://hacklog.mu/qemu-kvm-start-vm-with-shared-folder/


https://wiki.openwrt.org/doc/howto/qemu


Muy bueno, gentoo:


http://www.gossamer-threads.com/lists/gentoo/user/309633


*)Emular rasperri


http://paulscott.co.za/blog/full-raspberry-pi-raspbian-emulation-with-qemu/

#!/bin/bash
qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 512 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda recovery.img -soundhw ac97


qemu-system-arm -kernel boot/raspbian.img -cpu arm1176 -m 256 -M
versatilepb -no-reboot -serial stdio -append "root=/dev/sda5
rootfstype=ext4 rw init=/bin/bash console=ttyAMA0" -hda
img/ArchLinuxARM-2014.06-rpi.img


*) Compilarlo

http://www.linuxfromscratch.org/blfs/view/svn/postlfs/qemu.html
http://www.h7.dion.ne.jp/~qemu-win/Audio-en.html


sudo pacman -S qemu


sudo pacman -R qemu


sudo pacman -S linux-headers


 git clone git://git.qemu-project.org/qemu.git


whereis python


  ./configure --target-list=x86_64-softmmu --enable-debug --python=/usr/lib/python2.7

O bien, con este script:

if [ $(uname -m) = i686 ]; then
   QEMU_ARCH=i386-softmmu
else
   QEMU_ARCH=x86_64-softmmu
fi

mkdir -vp build &&
cd        build &&

../configure --prefix=/usr               \
             --sysconfdir=/etc           \
             --target-list=$QEMU_ARCH    \
             --audio-drv-list=alsa       \
             --docdir=/usr/share/doc/qemu-2.6.0 &&

unset QEMU_ARCH &&

make -j2

sudo make install


/usr/local/bin/qemu-system-x86_64  y el resto de comandos


usr/bin/qemu-kvm -m 1024 -name f15 -drive file=/images/f15.img,if=virtio -usb -device usb-host,hostbus=2,hostaddr=3


*)Windows Iso.


/home/user/qemu/qemu/bin/debug/native/x86_64-softmmu/qemu-system-x86_64-m 1024 -drive if=ide,file=Windows7qemu.qcow2,cache=none -cdrom Win7Sp1.iso




*) Driver Virtio, qemu, compartir carpeta:

https://wiki.archlinux.org/index.php/QEMU#virtio

https://wiki.archlinux.org/index.php/Libvirt

http://wiki.qemu.org/Documentation/9psetup

CONFIG_NET_9P=y
    CONFIG_NET_9P_VIRTIO=y
    CONFIG_NET_9P_DEBUG=y (Optional)
    CONFIG_9P_FS=y
    CONFIG_9P_FS_POSIX_ACL=y


sudo pacman -S      qemu-guest-agent


sudo nano /etc/mkinitcpio.conf


MODULES="virtio virtio_blk virtio_pci virtio_net" (da error)


sudo mkinitcpio -p linux


x86_64-softmmu/qemu-system-x86_64 -boot c -drive file=/images/xpbase.qcow2,if=virtio -m 384 -netdev type=tap,script=/etc/kvm/qemu-ifup,id=net0 -device virtio-net-pci,netdev=net0

sudo nano /etc/systemd/system/qemu@.service

su

echo 1 > /sys/kernel/mm/ksm/run


Kvm, "Virtualization Manager"

http://www.linux-kvm.org/page/Bugs

http://www.linux-kvm.org/page/KVM-unit-tests#Running_tests

http://wiki.qemu.org/KVM
     -no-kvm (use -machine accel=...)
    -no-kvm-irqchip (use -machine kernel_irqchip=...)
    -no-kvm-pit (ignored by recent qemu-kvm, switch off irchip completely)
    -no-kvm-pit-reinjection (use -global kvm-pit.lost_tick_policy=discard)
    -tdf (ignored by recent qemu-kvm, drift compensation for userspace timer devices will be re-introduced generically)
    -drive ...,boot=on (BIOS can boot from IDE, AHCI and virtio natively, use proprietary option ROM to boot from LSI SCSI controller)

     Whether the problem goes away if using the -no-kvm-irqchip or -no-kvm-pit switch.

    Whether the problem also appears with the -no-kvm switch.


Ver los módulos del kernel:

zgrep VIRTIO /proc/config.gz

Comprobar su funcionamiento:

https://wiki.archlinux.org/index.php/KVM

Sino muestran nada o 0 es que no lo hacen.

 lsmod | grep kvm
 lsmod | grep virtio


List of para-virtualized devices

    network device (virtio-net)
    block device (virtio-blk)
    controller device (virtio-scsi)
    serial device (virtio-serial)
virtio-net
virtio-blk
virtio-scsi
virtio-serial

Probar un módulo:


Manual module handling

Kernel modules are handled by tools provided by kmod package. You can use these tools manually.
Note: If you have upgraded your kernel but have not yet rebooted, modprobe will fail with no error message and exit with code 1, because the path /lib/modules/$(uname -r)/ no longer exists. Check manually if this path exists when modprobe failed to determine if this is the case.

To load a module:

# modprobe module_name

To load a module by filename (i.e. one that is not installed in /lib/modules/$(uname -r)/):

# insmod filename [args]

To unload a module:

# modprobe -r module_name

Or, alternatively:

# rmmod module_name



Habilitar Nested

On host, enable nested feature for kvm_intel:

# modprobe -r kvm_intel
# modprobe kvm_intel nested=1

To make it permanent (see Kernel modules#Setting module options):

/etc/modprobe.d/modprobe.conf

options kvm_intel nested=1

Verify that feature is activated:

$ systool -m kvm_intel -v | grep nested

    nested              = "Y"

Run guest VM with following command:

$ qemu-system-x86_64 -enable-kvm -cpu host

Boot VM and check if vmx flag is present:

$ egrep --color=auto 'vmx|svm' /proc/cpuinfo


Otra forma de habilitar compartir carpetas en qemu:


http://blog.desdelinux.net/debian-7-wheezy-y-qemu-kvm/


yaourt -S libvirt bridge-utils virt-manager hal-flash

cierra sesión

virt

/etc/libvirt/libvirtd.conf

#unix_sock_group = "libvirt"
#unix_sock_ro_perms = "0777"  # set to 0770 to deny non-group libvirt users
#unix_sock_rw_perms = "0770"
#auth_unix_ro = "none"
#auth_unix_rw = "none"


sudo systemctl enable libvirtd.service virtlogd.service

sudo systemctl start libvirtd.service virtlogd.service

(virtlogd.socket  virtlockd.socket)



Qemu sin interfaz:


Pasos que hice:

Crea un script de inicio

Instalar con downgrade qemu la versión más vieja,

Corra la carpeta caca-noseque, porque dice que ya está instalada y no se puede bajar de grado,

Reinstala Linux.

Crea enlaces con ln -s a los archivos que no existan a otros más avanzados.

Lánzalo con este script:
#!/bin/bash

qemu-system-x86_64 -machine smm=off -display sdl,frame=off,window_close=off -enable-kvm -soundhw ac97 -k es -m 500 -drive file=Android51,format=raw

Instalé la versión testing:

sudo nano /etc/pacman.conf

sudo pacman -S testing/qemu

Y la desistalé:

sudo pacman -R testing/qemu


Instala la versión a compilar.


Dependencias opcionales de qemu:

 ALSA-1.1.2, BlueZ-5.41, Check-0.10.0, cURL-7.50.1, Cyrus SASL-2.1.26, GnuTLS-3.5.3, GTK+-2.24.30, GTK+-3.20.9, libusb-1.0.20, libgcrypt-1.7.3, LZO-2.09, Nettle-3.2, NSS-3.26 (for libcacard.so), Mesa-12.0.1, SDL-1.2.15, VTE-0.44.2, and libssh2




 

BannerFans.com
Este sitio web fue creado de forma gratuita con PaginaWebGratis.es. ¿Quieres también tu sitio web propio?
Registrarse gratis