¿Cómo ejecutar Ubuntu 16.04 ARM en QEMU?


9

Mi objetivo es ejecutar Ubuntu 16.04 (ARM) en Qemu (en Ubuntu 16.04 x64 host).

Traté de seguir este antiguo tutorial sin éxito:

Home directory not accessible: Permission denied
pulseaudio: pa_context_connect() failed
pulseaudio: Reason: Connection refused
pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver
Could not initialize SDL(No available video device) - exiting

En lugar de la debian_squeeze_armel_standard.qcow2imagen utilizada allí, utilicé ubuntu-16.04-preinstalled-server-armhf + raspi2.img .

Olvidando el artículo mencionado anteriormente, ¿cuál es la forma correcta de ejecutar Ubuntu 16.04-arm encima de Qemu?

Si no es posible ejecutarlo sobre Qemu fácilmente, ¿hay alguna otra alternativa?

Respuestas:


0

Esto no funcionará porque la imagen que está utilizando está precompilada para el dispositivo Raspberry Pi 2 y solo funcionará en Raspberry Pi 2. Pruebe este tutorial


Gracias. Voy a intentarlo más tarde. Creo que eso responderá a mi pregunta.
lepe

1

En esta respuesta: ¿Hay alguna imagen de Ubuntu QEMU preconstruida (32 bits) en línea? He descrito las siguientes configuraciones de trabajo para Ubuntu 18.04 invitado / host:

  • imagen en la nube arm64: configuración más rápida para comenzar
  • debootstrap arm64: razonablemente rápido, pero permite una mayor personalización de imagen

Esas configuraciones proporcionan imágenes de disco preconstruidas y no pasan por el instalador. Son las mejores opciones que he visto hasta ahora.

A continuación, también he logrado ejecutar la imagen del servidor arm64 en QEMU. Sin embargo, esto pasa por el instalador, que es prácticamente imposible de hacer, a menos que no esté en un host ARM con KVM. Esto es especialmente doloroso porque se requieren docenas de interacciones para finalizar la instalación.

Aquí está el script del servidor, probado en un host Ubuntu 18.10:

#!/usr/bin/env bash

set -eux

# Tested on Ubuntu 18.10.
# - /superuser/942657/how-to-test-arm-ubuntu-under-qemu-the-easiest-way
# - /ubuntu/797599/how-to-run-ubuntu-16-04-arm-in-qemu

# Parameters.
id=ubuntu-18.04.1-server-arm64
#id=debian-9.6.0-arm64-xfce-CD-1
img="${id}.img.qcow2"
img_snapshot="${id}.img.snapshot.qcow2"
iso="${id}.iso"
flash0="${id}-flash0.img"
flash1="${id}-flash1.img"

# Images.
if [ ! -f "$iso" ]; then
  wget "http://cdimage.ubuntu.com/releases/18.04/release/${iso}"
fi
if [ ! -f "$img" ]; then
  qemu-img create -f qcow2 "$img" 1T
fi
if [ ! -f "$img_snapshot" ]; then
  qemu-img \
    create \
    -b "$img" \
    -f qcow2 \
    "$img_snapshot" \
  ;
fi
if [ ! -f "$flash0" ]; then
  dd if=/dev/zero of="$flash0" bs=1M count=64
  dd if=/usr/share/qemu-efi/QEMU_EFI.fd of="$flash0" conv=notrunc
fi
if [ ! -f "$flash1" ]; then
  dd if=/dev/zero of="$flash1" bs=1M count=64
fi

# Run.
#
# cdrom must be scsi or else the installation fails midway with:
#
# > Detect and mount CD-ROM
# >
# > Your installation CD-ROM couldn't be mounted. This probably means
# > that the CD-ROM was not in the drive. If so you can insert it and try
# > again.
# >
# > Retry mounting the CD-ROM?
# > Your installation CD-ROM couldn't be mounted.
#
# This is because the drivers for the default virtio are not installed in the ISO,
# because in the past it was not reliable on qemu-system-aarch64.
#
# See also:
# https://bazaar.launchpad.net/~ubuntu-testcase/ubuntu-manual-tests/trunk/view/head:/testcases/image/1688_ARM64_Headless_KVM_Guest
qemu-system-aarch64 \
  -cpu cortex-a57 \
  -device rtl8139,netdev=net0 \
  -device virtio-scsi-device \
  -device scsi-cd,drive=cdrom \
  -device virtio-blk-device,drive=hd0 \
  -drive "file=${iso},id=cdrom,if=none,media=cdrom" \
  -drive "if=none,file=${img_snapshot},id=hd0" \
  -m 2G \
  -machine virt \
  -netdev user,id=net0 \
  -nographic \
  -pflash "$flash0" \
  -pflash "$flash1" \
  -smp 2 \
;

GitHub aguas arriba .

Consulte también esto para la emulación Raspberry Pi: /programming/28880833/how-to-emulate-the-raspberry-pi-2-on-qemu/45814913#45814913

El escritorio amd64 se muestra en: ¿Cómo ejecutar Ubuntu 16.04 Desktop en QEMU?

Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.