How to run Ubuntu 16.04 Desktop on QEMU?












5















I've installed Ubuntu 16.04 Desktop on QEMU, but now when I start it with:



qemu-system-i386 -m 1024M -enable-kvm -drive file=./ubuntu-desktop.img,index=0,media=disk,format=raw


I see this picture:
enter image description here



Whats going on? How can I fix this?










share|improve this question


















  • 1





    try -hda rather than -drive and remove all the extra options with drive. Just pass the hard disk file.

    – Mark Yisri
    Feb 17 '17 at 23:20











  • Is it possible to use libvirt?

    – Kong Chun Ho
    Jun 15 '18 at 8:06
















5















I've installed Ubuntu 16.04 Desktop on QEMU, but now when I start it with:



qemu-system-i386 -m 1024M -enable-kvm -drive file=./ubuntu-desktop.img,index=0,media=disk,format=raw


I see this picture:
enter image description here



Whats going on? How can I fix this?










share|improve this question


















  • 1





    try -hda rather than -drive and remove all the extra options with drive. Just pass the hard disk file.

    – Mark Yisri
    Feb 17 '17 at 23:20











  • Is it possible to use libvirt?

    – Kong Chun Ho
    Jun 15 '18 at 8:06














5












5








5


1






I've installed Ubuntu 16.04 Desktop on QEMU, but now when I start it with:



qemu-system-i386 -m 1024M -enable-kvm -drive file=./ubuntu-desktop.img,index=0,media=disk,format=raw


I see this picture:
enter image description here



Whats going on? How can I fix this?










share|improve this question














I've installed Ubuntu 16.04 Desktop on QEMU, but now when I start it with:



qemu-system-i386 -m 1024M -enable-kvm -drive file=./ubuntu-desktop.img,index=0,media=disk,format=raw


I see this picture:
enter image description here



Whats going on? How can I fix this?







virtualization kvm qemu






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 17 '17 at 23:19









BPSBPS

12613




12613








  • 1





    try -hda rather than -drive and remove all the extra options with drive. Just pass the hard disk file.

    – Mark Yisri
    Feb 17 '17 at 23:20











  • Is it possible to use libvirt?

    – Kong Chun Ho
    Jun 15 '18 at 8:06














  • 1





    try -hda rather than -drive and remove all the extra options with drive. Just pass the hard disk file.

    – Mark Yisri
    Feb 17 '17 at 23:20











  • Is it possible to use libvirt?

    – Kong Chun Ho
    Jun 15 '18 at 8:06








1




1





try -hda rather than -drive and remove all the extra options with drive. Just pass the hard disk file.

– Mark Yisri
Feb 17 '17 at 23:20





try -hda rather than -drive and remove all the extra options with drive. Just pass the hard disk file.

– Mark Yisri
Feb 17 '17 at 23:20













Is it possible to use libvirt?

– Kong Chun Ho
Jun 15 '18 at 8:06





Is it possible to use libvirt?

– Kong Chun Ho
Jun 15 '18 at 8:06










1 Answer
1






active

oldest

votes


















4














Working Ubuntu 18.04 setup



Tested in an Ubuntu 18.10 host.



enter image description here



ubuntu-18.04.1-desktop-amd64.sh



#!/usr/bin/env bash

set -eux

# Parameters.
id=ubuntu-18.04.1-desktop-amd64
disk_img="${id}.img.qcow2"
disk_img_snapshot="${id}.snapshot.qcow2"
iso="${id}.iso"

# Get image.
if [ ! -f "$iso" ]; then
wget "http://releases.ubuntu.com/18.04/${iso}"
fi

# Go through installer manually.
if [ ! -f "$disk_img" ]; then
qemu-img create -f qcow2 "$disk_img" 1T
qemu-system-x86_64
-cdrom "$iso"
-drive "file=${disk_img},format=qcow2"
-enable-kvm
-m 2G
-smp 2
;
fi

# Snapshot the installation.
if [ ! -f "$disk_img_snapshot" ]; then
qemu-img
create
-b "$disk_img"
-f qcow2
"$disk_img_snapshot"
;
fi

# Run the installed image.
qemu-system-x86_64
-drive "file=${disk_img_snapshot},format=qcow2"
-enable-kvm
-m 2G
-smp 2
-soundhw hda
-vga virtio
"$@"
;


GitHub upstream.



This script will do two QEMU runs:




  • first an installation run. Gets kipped if already done.

  • then a regular boot


The fist time QEMU comes up




  • Install Ubuntu

  • continue, continue, continue...

  • wait a few minutes

  • at the end "Restart now"

  • now you can close the QEMU window


The installer looks like this:



enter image description here



After the install is complete, the script automatically takes a snapshot, and starts a regular boot.



Anytime you want to go back to the pristine install, just remove the snapshot and re-run the script:



rm ubuntu-18.04-desktop-amd64.snapshot.qcow2
./ubuntu-18.04.1-desktop-amd64.sh


and the snapshot will be re-generated starting from the clean install.



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



This setup has by default a funky system that automatically resizes the guest resolution to best fit the QEMU window size, just either:




  • drag the window with the mouse

  • toggle fullscreen with Ctrl + Alt + F or or start QEMU with -full-screen


Notes:




  • -vga virtio option is to be able to get higher resolutions: https://superuser.com/questions/132322/how-to-increase-the-visualized-screen-resolution-on-qemu-kvm/1331924#1331924 Toggle full screen with:


  • -soundhw hda enables sound. Why does not QEMU enable it by default beats me.



  • Once inside the VM, reduce the GRUB menu wait time and show some boot messages for next boot with:



    printf 'GRUB_TIMEOUT=1nGRUB_CMDLINE_LINUX_DEFAULT=""n' | sudo tee -a /etc/default/grub
    sudo update-grub



  • TODO clipboard sharing:




    • https://unix.stackexchange.com/questions/109117/virt-manager-copy-paste-functionality-to-the-vm

    • How can I copy&paste from the host to a KVM guest?

    • https://wiki.archlinux.org/index.php/QEMU#SPICE

    • https://www.linux-kvm.org/page/SPICE


    Tried -spice port=5930,disable-ticketing + remote-viewer spice://127.0.0.1:5930, and spice-vdagent is pre-installed on guest, but no success.



    The root cause of the mess is that QEMU devs seem more focused on non-interactive usage, rather than implementing things like this reliably and therefore killing VirtualBox once and for all: https://bugs.launchpad.net/qemu/+bug/614958



  • TODO: host 3D acceleration. Still with SPICE and QXL, glxgears gives 1k FPS, and the exact same with regular SDL. But on host __GL_SYNC_TO_VBLANK=0 vblank_mode=0 glxgears gives 20k FPS, so I'm guessing graphics were not accelerated?



Related: https://unix.stackexchange.com/questions/108122/installing-ubuntu-13-0-desktop-in-qemu



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.



Server and -nographic



Didn't work our, asked at: How to boot and install the Ubuntu server image on QEMU -nographic without the GUI?



Prebuilt bootable images



If you want an image that boots without the need for any interaction on the installer, see: Is there any prebuilt QEMU Ubuntu image(32bit) online?






share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f884534%2fhow-to-run-ubuntu-16-04-desktop-on-qemu%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4














    Working Ubuntu 18.04 setup



    Tested in an Ubuntu 18.10 host.



    enter image description here



    ubuntu-18.04.1-desktop-amd64.sh



    #!/usr/bin/env bash

    set -eux

    # Parameters.
    id=ubuntu-18.04.1-desktop-amd64
    disk_img="${id}.img.qcow2"
    disk_img_snapshot="${id}.snapshot.qcow2"
    iso="${id}.iso"

    # Get image.
    if [ ! -f "$iso" ]; then
    wget "http://releases.ubuntu.com/18.04/${iso}"
    fi

    # Go through installer manually.
    if [ ! -f "$disk_img" ]; then
    qemu-img create -f qcow2 "$disk_img" 1T
    qemu-system-x86_64
    -cdrom "$iso"
    -drive "file=${disk_img},format=qcow2"
    -enable-kvm
    -m 2G
    -smp 2
    ;
    fi

    # Snapshot the installation.
    if [ ! -f "$disk_img_snapshot" ]; then
    qemu-img
    create
    -b "$disk_img"
    -f qcow2
    "$disk_img_snapshot"
    ;
    fi

    # Run the installed image.
    qemu-system-x86_64
    -drive "file=${disk_img_snapshot},format=qcow2"
    -enable-kvm
    -m 2G
    -smp 2
    -soundhw hda
    -vga virtio
    "$@"
    ;


    GitHub upstream.



    This script will do two QEMU runs:




    • first an installation run. Gets kipped if already done.

    • then a regular boot


    The fist time QEMU comes up




    • Install Ubuntu

    • continue, continue, continue...

    • wait a few minutes

    • at the end "Restart now"

    • now you can close the QEMU window


    The installer looks like this:



    enter image description here



    After the install is complete, the script automatically takes a snapshot, and starts a regular boot.



    Anytime you want to go back to the pristine install, just remove the snapshot and re-run the script:



    rm ubuntu-18.04-desktop-amd64.snapshot.qcow2
    ./ubuntu-18.04.1-desktop-amd64.sh


    and the snapshot will be re-generated starting from the clean install.



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



    This setup has by default a funky system that automatically resizes the guest resolution to best fit the QEMU window size, just either:




    • drag the window with the mouse

    • toggle fullscreen with Ctrl + Alt + F or or start QEMU with -full-screen


    Notes:




    • -vga virtio option is to be able to get higher resolutions: https://superuser.com/questions/132322/how-to-increase-the-visualized-screen-resolution-on-qemu-kvm/1331924#1331924 Toggle full screen with:


    • -soundhw hda enables sound. Why does not QEMU enable it by default beats me.



    • Once inside the VM, reduce the GRUB menu wait time and show some boot messages for next boot with:



      printf 'GRUB_TIMEOUT=1nGRUB_CMDLINE_LINUX_DEFAULT=""n' | sudo tee -a /etc/default/grub
      sudo update-grub



    • TODO clipboard sharing:




      • https://unix.stackexchange.com/questions/109117/virt-manager-copy-paste-functionality-to-the-vm

      • How can I copy&paste from the host to a KVM guest?

      • https://wiki.archlinux.org/index.php/QEMU#SPICE

      • https://www.linux-kvm.org/page/SPICE


      Tried -spice port=5930,disable-ticketing + remote-viewer spice://127.0.0.1:5930, and spice-vdagent is pre-installed on guest, but no success.



      The root cause of the mess is that QEMU devs seem more focused on non-interactive usage, rather than implementing things like this reliably and therefore killing VirtualBox once and for all: https://bugs.launchpad.net/qemu/+bug/614958



    • TODO: host 3D acceleration. Still with SPICE and QXL, glxgears gives 1k FPS, and the exact same with regular SDL. But on host __GL_SYNC_TO_VBLANK=0 vblank_mode=0 glxgears gives 20k FPS, so I'm guessing graphics were not accelerated?



    Related: https://unix.stackexchange.com/questions/108122/installing-ubuntu-13-0-desktop-in-qemu



    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.



    Server and -nographic



    Didn't work our, asked at: How to boot and install the Ubuntu server image on QEMU -nographic without the GUI?



    Prebuilt bootable images



    If you want an image that boots without the need for any interaction on the installer, see: Is there any prebuilt QEMU Ubuntu image(32bit) online?






    share|improve this answer






























      4














      Working Ubuntu 18.04 setup



      Tested in an Ubuntu 18.10 host.



      enter image description here



      ubuntu-18.04.1-desktop-amd64.sh



      #!/usr/bin/env bash

      set -eux

      # Parameters.
      id=ubuntu-18.04.1-desktop-amd64
      disk_img="${id}.img.qcow2"
      disk_img_snapshot="${id}.snapshot.qcow2"
      iso="${id}.iso"

      # Get image.
      if [ ! -f "$iso" ]; then
      wget "http://releases.ubuntu.com/18.04/${iso}"
      fi

      # Go through installer manually.
      if [ ! -f "$disk_img" ]; then
      qemu-img create -f qcow2 "$disk_img" 1T
      qemu-system-x86_64
      -cdrom "$iso"
      -drive "file=${disk_img},format=qcow2"
      -enable-kvm
      -m 2G
      -smp 2
      ;
      fi

      # Snapshot the installation.
      if [ ! -f "$disk_img_snapshot" ]; then
      qemu-img
      create
      -b "$disk_img"
      -f qcow2
      "$disk_img_snapshot"
      ;
      fi

      # Run the installed image.
      qemu-system-x86_64
      -drive "file=${disk_img_snapshot},format=qcow2"
      -enable-kvm
      -m 2G
      -smp 2
      -soundhw hda
      -vga virtio
      "$@"
      ;


      GitHub upstream.



      This script will do two QEMU runs:




      • first an installation run. Gets kipped if already done.

      • then a regular boot


      The fist time QEMU comes up




      • Install Ubuntu

      • continue, continue, continue...

      • wait a few minutes

      • at the end "Restart now"

      • now you can close the QEMU window


      The installer looks like this:



      enter image description here



      After the install is complete, the script automatically takes a snapshot, and starts a regular boot.



      Anytime you want to go back to the pristine install, just remove the snapshot and re-run the script:



      rm ubuntu-18.04-desktop-amd64.snapshot.qcow2
      ./ubuntu-18.04.1-desktop-amd64.sh


      and the snapshot will be re-generated starting from the clean install.



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



      This setup has by default a funky system that automatically resizes the guest resolution to best fit the QEMU window size, just either:




      • drag the window with the mouse

      • toggle fullscreen with Ctrl + Alt + F or or start QEMU with -full-screen


      Notes:




      • -vga virtio option is to be able to get higher resolutions: https://superuser.com/questions/132322/how-to-increase-the-visualized-screen-resolution-on-qemu-kvm/1331924#1331924 Toggle full screen with:


      • -soundhw hda enables sound. Why does not QEMU enable it by default beats me.



      • Once inside the VM, reduce the GRUB menu wait time and show some boot messages for next boot with:



        printf 'GRUB_TIMEOUT=1nGRUB_CMDLINE_LINUX_DEFAULT=""n' | sudo tee -a /etc/default/grub
        sudo update-grub



      • TODO clipboard sharing:




        • https://unix.stackexchange.com/questions/109117/virt-manager-copy-paste-functionality-to-the-vm

        • How can I copy&paste from the host to a KVM guest?

        • https://wiki.archlinux.org/index.php/QEMU#SPICE

        • https://www.linux-kvm.org/page/SPICE


        Tried -spice port=5930,disable-ticketing + remote-viewer spice://127.0.0.1:5930, and spice-vdagent is pre-installed on guest, but no success.



        The root cause of the mess is that QEMU devs seem more focused on non-interactive usage, rather than implementing things like this reliably and therefore killing VirtualBox once and for all: https://bugs.launchpad.net/qemu/+bug/614958



      • TODO: host 3D acceleration. Still with SPICE and QXL, glxgears gives 1k FPS, and the exact same with regular SDL. But on host __GL_SYNC_TO_VBLANK=0 vblank_mode=0 glxgears gives 20k FPS, so I'm guessing graphics were not accelerated?



      Related: https://unix.stackexchange.com/questions/108122/installing-ubuntu-13-0-desktop-in-qemu



      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.



      Server and -nographic



      Didn't work our, asked at: How to boot and install the Ubuntu server image on QEMU -nographic without the GUI?



      Prebuilt bootable images



      If you want an image that boots without the need for any interaction on the installer, see: Is there any prebuilt QEMU Ubuntu image(32bit) online?






      share|improve this answer




























        4












        4








        4







        Working Ubuntu 18.04 setup



        Tested in an Ubuntu 18.10 host.



        enter image description here



        ubuntu-18.04.1-desktop-amd64.sh



        #!/usr/bin/env bash

        set -eux

        # Parameters.
        id=ubuntu-18.04.1-desktop-amd64
        disk_img="${id}.img.qcow2"
        disk_img_snapshot="${id}.snapshot.qcow2"
        iso="${id}.iso"

        # Get image.
        if [ ! -f "$iso" ]; then
        wget "http://releases.ubuntu.com/18.04/${iso}"
        fi

        # Go through installer manually.
        if [ ! -f "$disk_img" ]; then
        qemu-img create -f qcow2 "$disk_img" 1T
        qemu-system-x86_64
        -cdrom "$iso"
        -drive "file=${disk_img},format=qcow2"
        -enable-kvm
        -m 2G
        -smp 2
        ;
        fi

        # Snapshot the installation.
        if [ ! -f "$disk_img_snapshot" ]; then
        qemu-img
        create
        -b "$disk_img"
        -f qcow2
        "$disk_img_snapshot"
        ;
        fi

        # Run the installed image.
        qemu-system-x86_64
        -drive "file=${disk_img_snapshot},format=qcow2"
        -enable-kvm
        -m 2G
        -smp 2
        -soundhw hda
        -vga virtio
        "$@"
        ;


        GitHub upstream.



        This script will do two QEMU runs:




        • first an installation run. Gets kipped if already done.

        • then a regular boot


        The fist time QEMU comes up




        • Install Ubuntu

        • continue, continue, continue...

        • wait a few minutes

        • at the end "Restart now"

        • now you can close the QEMU window


        The installer looks like this:



        enter image description here



        After the install is complete, the script automatically takes a snapshot, and starts a regular boot.



        Anytime you want to go back to the pristine install, just remove the snapshot and re-run the script:



        rm ubuntu-18.04-desktop-amd64.snapshot.qcow2
        ./ubuntu-18.04.1-desktop-amd64.sh


        and the snapshot will be re-generated starting from the clean install.



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



        This setup has by default a funky system that automatically resizes the guest resolution to best fit the QEMU window size, just either:




        • drag the window with the mouse

        • toggle fullscreen with Ctrl + Alt + F or or start QEMU with -full-screen


        Notes:




        • -vga virtio option is to be able to get higher resolutions: https://superuser.com/questions/132322/how-to-increase-the-visualized-screen-resolution-on-qemu-kvm/1331924#1331924 Toggle full screen with:


        • -soundhw hda enables sound. Why does not QEMU enable it by default beats me.



        • Once inside the VM, reduce the GRUB menu wait time and show some boot messages for next boot with:



          printf 'GRUB_TIMEOUT=1nGRUB_CMDLINE_LINUX_DEFAULT=""n' | sudo tee -a /etc/default/grub
          sudo update-grub



        • TODO clipboard sharing:




          • https://unix.stackexchange.com/questions/109117/virt-manager-copy-paste-functionality-to-the-vm

          • How can I copy&paste from the host to a KVM guest?

          • https://wiki.archlinux.org/index.php/QEMU#SPICE

          • https://www.linux-kvm.org/page/SPICE


          Tried -spice port=5930,disable-ticketing + remote-viewer spice://127.0.0.1:5930, and spice-vdagent is pre-installed on guest, but no success.



          The root cause of the mess is that QEMU devs seem more focused on non-interactive usage, rather than implementing things like this reliably and therefore killing VirtualBox once and for all: https://bugs.launchpad.net/qemu/+bug/614958



        • TODO: host 3D acceleration. Still with SPICE and QXL, glxgears gives 1k FPS, and the exact same with regular SDL. But on host __GL_SYNC_TO_VBLANK=0 vblank_mode=0 glxgears gives 20k FPS, so I'm guessing graphics were not accelerated?



        Related: https://unix.stackexchange.com/questions/108122/installing-ubuntu-13-0-desktop-in-qemu



        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.



        Server and -nographic



        Didn't work our, asked at: How to boot and install the Ubuntu server image on QEMU -nographic without the GUI?



        Prebuilt bootable images



        If you want an image that boots without the need for any interaction on the installer, see: Is there any prebuilt QEMU Ubuntu image(32bit) online?






        share|improve this answer















        Working Ubuntu 18.04 setup



        Tested in an Ubuntu 18.10 host.



        enter image description here



        ubuntu-18.04.1-desktop-amd64.sh



        #!/usr/bin/env bash

        set -eux

        # Parameters.
        id=ubuntu-18.04.1-desktop-amd64
        disk_img="${id}.img.qcow2"
        disk_img_snapshot="${id}.snapshot.qcow2"
        iso="${id}.iso"

        # Get image.
        if [ ! -f "$iso" ]; then
        wget "http://releases.ubuntu.com/18.04/${iso}"
        fi

        # Go through installer manually.
        if [ ! -f "$disk_img" ]; then
        qemu-img create -f qcow2 "$disk_img" 1T
        qemu-system-x86_64
        -cdrom "$iso"
        -drive "file=${disk_img},format=qcow2"
        -enable-kvm
        -m 2G
        -smp 2
        ;
        fi

        # Snapshot the installation.
        if [ ! -f "$disk_img_snapshot" ]; then
        qemu-img
        create
        -b "$disk_img"
        -f qcow2
        "$disk_img_snapshot"
        ;
        fi

        # Run the installed image.
        qemu-system-x86_64
        -drive "file=${disk_img_snapshot},format=qcow2"
        -enable-kvm
        -m 2G
        -smp 2
        -soundhw hda
        -vga virtio
        "$@"
        ;


        GitHub upstream.



        This script will do two QEMU runs:




        • first an installation run. Gets kipped if already done.

        • then a regular boot


        The fist time QEMU comes up




        • Install Ubuntu

        • continue, continue, continue...

        • wait a few minutes

        • at the end "Restart now"

        • now you can close the QEMU window


        The installer looks like this:



        enter image description here



        After the install is complete, the script automatically takes a snapshot, and starts a regular boot.



        Anytime you want to go back to the pristine install, just remove the snapshot and re-run the script:



        rm ubuntu-18.04-desktop-amd64.snapshot.qcow2
        ./ubuntu-18.04.1-desktop-amd64.sh


        and the snapshot will be re-generated starting from the clean install.



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



        This setup has by default a funky system that automatically resizes the guest resolution to best fit the QEMU window size, just either:




        • drag the window with the mouse

        • toggle fullscreen with Ctrl + Alt + F or or start QEMU with -full-screen


        Notes:




        • -vga virtio option is to be able to get higher resolutions: https://superuser.com/questions/132322/how-to-increase-the-visualized-screen-resolution-on-qemu-kvm/1331924#1331924 Toggle full screen with:


        • -soundhw hda enables sound. Why does not QEMU enable it by default beats me.



        • Once inside the VM, reduce the GRUB menu wait time and show some boot messages for next boot with:



          printf 'GRUB_TIMEOUT=1nGRUB_CMDLINE_LINUX_DEFAULT=""n' | sudo tee -a /etc/default/grub
          sudo update-grub



        • TODO clipboard sharing:




          • https://unix.stackexchange.com/questions/109117/virt-manager-copy-paste-functionality-to-the-vm

          • How can I copy&paste from the host to a KVM guest?

          • https://wiki.archlinux.org/index.php/QEMU#SPICE

          • https://www.linux-kvm.org/page/SPICE


          Tried -spice port=5930,disable-ticketing + remote-viewer spice://127.0.0.1:5930, and spice-vdagent is pre-installed on guest, but no success.



          The root cause of the mess is that QEMU devs seem more focused on non-interactive usage, rather than implementing things like this reliably and therefore killing VirtualBox once and for all: https://bugs.launchpad.net/qemu/+bug/614958



        • TODO: host 3D acceleration. Still with SPICE and QXL, glxgears gives 1k FPS, and the exact same with regular SDL. But on host __GL_SYNC_TO_VBLANK=0 vblank_mode=0 glxgears gives 20k FPS, so I'm guessing graphics were not accelerated?



        Related: https://unix.stackexchange.com/questions/108122/installing-ubuntu-13-0-desktop-in-qemu



        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.



        Server and -nographic



        Didn't work our, asked at: How to boot and install the Ubuntu server image on QEMU -nographic without the GUI?



        Prebuilt bootable images



        If you want an image that boots without the need for any interaction on the installer, see: Is there any prebuilt QEMU Ubuntu image(32bit) online?







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 10 hours ago

























        answered Jun 15 '18 at 8:02









        Ciro Santilli 新疆改造中心 六四事件 法轮功Ciro Santilli 新疆改造中心 六四事件 法轮功

        9,34444347




        9,34444347






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f884534%2fhow-to-run-ubuntu-16-04-desktop-on-qemu%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            GameSpot

            connect to host localhost port 22: Connection refused

            Getting a Wifi WPA2 wifi connection