3

Following are the details of my system: Fedora Core-18, i686.

I am trying to install ubuntu in the qemu. Following are the commands I executed:

qemu-img create ubuntu.img 8G
qemu-system-i386 -hda ubuntu.img -boot d -cdrom ./ubuntu-13.10-desktop-i386.iso -m 512

After executing the second command the window pops up and it shows UBUNTU getting started but after that the window just becomes black with no activity.

user2453475
  • 41
  • 1
  • 1
  • 3

3 Answers3

4

The problem is that you are emulating and not virtualizing, and emulating is resource consuming, so the boot takes a very long time to finish.

To speed things up, add the -enable-kvm flag to enable KVM virtualization:

qemu-system-i386 -hda ubuntu.img -boot d -cdrom ./ubuntu-13.10-desktop-i386.iso -m 512 -enable-kvm

This has also been asked at: https://askubuntu.com/questions/419958/why-am-i-getting-a-black-screen-when-booting-vm-using-qemu

Hojat Modaresi
  • 431
  • 4
  • 9
1

You don't specify whether you're using QEMU or KVM, but as @BodhiZazen said in the comments, I don't think vanilla QEMU can support high end graphics such as what Unity requires.

If you're actually trying to use KVM, then I'd recommend using the GUI tool virt-manager to perform your VM Guest installations rather than the command line. It's easier to mount ISO media and reconfigure the Guest VM through the GUI.

Screenshots

   ss of virtmanager #1

   ss of virtmanager #2

You can see more of virt-manager in action on the project's website and read about it features there as well.

slm
  • 363,520
  • 117
  • 767
  • 871
0

Working Ubuntu 18.04 host / guest setup

I cannot reproduce with the following setup:

wget http://releases.ubuntu.com/xenial/ubuntu-18.04-desktop-amd64.iso
qemu-img create -f qcow2 ubuntu-18.04-desktop-amd64.img.qcow2 16G
qemu-system-x86_64 \
  -cdrom ubuntu-18.04-desktop-amd64.iso \
  -drive file=ubuntu-18.04-desktop-amd64.qcow2,format=qcow2 \
  -enable-kvm \
  -m 2G \
  -smp 2 \
  -vga virtio \
;

Then on the GUI:

  • Install Ubuntu
  • continue, continue, continue...
  • wait a few minutes
  • at the end "Restart now"
  • now you can close the QEMU window

After the install is complete, I recommend using a disk snapshot in case you ever want to go back to the pristine install (a common use case for testing software):

qemu-img create -f qcow2 -b ubuntu-18.04-desktop-amd64.qcow2 \
                            ubuntu-18.04-desktop-amd64.snapshot.qcow2

and then restart the system from the snapshot disk:

qemu-system-x86_64 \
  -drive file=ubuntu-18.04-desktop-amd64.snapshot.qcow2,format=qcow2 \
  -enable-kvm \
  -m 2G \
  -smp 2 \
  -vga virtio \
;

Then anytime you want to go back to the pristine install, just re-run:

qemu-img create -f qcow2 -b ubuntu-18.04-desktop-amd64.qcow2 \
                            ubuntu-18.04-desktop-amd64.snapshot.qcow2

The snapshot only stores the diffs between the original image, and so it does not take a lot of disk space.

Tested on an Ubuntu 18.04 host, QEMU 1:2.11+dfsg-1ubuntu7.3, nvidia-384 version 390.48-0ubuntu3, Lenovo ThinkPad P51, NVIDIA Corporation GM107GLM [Quadro M1200 Mobile] GPU.

enter image description here

Notes:

Related: How to install Ubuntu 13.10 Desktop in QEMU?

Prebuilt bootable images

If you want an image that boots without the need for any interaction on the installer, see: https://askubuntu.com/questions/281763/is-there-any-prebuilt-qemu-ubuntu-image32bit-online