Posted: . At: 9:03 AM. This was 6 years ago. Post ID: 11997
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.



Sponsored



How to setup a simple qemu VM and use networking.


This script will run a qemu VM and setup networking easily. This is very simple.

  1 #!/bin/sh
  2 
  3 export QEMU_AUDIO_DRV=alsa
  4 DISKIMG=~/win7.img
  5 WIN7IMG=~/Downloads/win7.iso
  6 VIRTIMG=~/Downloads/virtio-win-0.1-81.iso
  7 qemu-system-x86_64 --enable-kvm -drive file=${DISKIMG},if=virtio -m 4096 \
  8 -net nic,model=virtio -net user -cdrom ${WIN7IMG} \
  9 -drive file=${VIRTIMG},index=3,media=cdrom \
 10 -rtc base=localtime,clock=host -smp cores=4,threads=4 \
 11 -usbdevice tablet -soundhw ac97 -cpu host -vga vmware
 12 

This is how I used qemu to run a Windows Operating System on a Linux desktop. It runs very fast and is great for testing Windows software in a disposable VM in case it ends up being malware. Qemu is faster than Virtualbox in my opinion. It has different executables to support various CPU architectures. Such as MIPS, Sun SPARC, ARM et cetera. This means it is perfect for testing an ISO of Sparc Debian for example. Instead of purchasing a Sun SPARC machine to run an operating system, test it in a Virtual Machine instead. But you will need the open BIOS files for those CPU architectures. The Sparc64 BIOS image is available here.

Installing Windows 10 enterprise in a qemu VM.
Installing Windows 10 enterprise in a qemu VM.

Networking is supported by this script. A great way to test an Ubuntu ISO very quickly if running a certain package on that distribution is desired.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.