Changes

Jump to navigation Jump to search
1,977 bytes added ,  08:26, 16 November 2019
Line 1: Line 1: −
The qemu emulation environment lets you run a variety of software on your computer in a protected environment. This includes software that is incompatible with your operating system. See also [[VMWare]] and [[WINE]].
+
<noinclude>[[Category:Virtual machine or platform emulator]]</noinclude>
 +
The [[wikipedia:QEMU|QEMU]] emulation environment, including the accelerators kqemu and kvm, lets you run a variety of software on your computer in a protected environment. This includes software that is incompatible with your operating system, and software for different processors. Other options are [[VirtualBox]] (Free Software) and [[VMware]], commercial software with a no-cost runtime version.
    
==Use Cases==
 
==Use Cases==
   −
* Windows: Run Sugar, School Server, Linux more generally (for example, as a method for shifting from Windows to Linux)
+
* [[Windows]]: Run [[Sugar]], [[olpc:School_server|School Server]], Linux more generally (for example, as a method for shifting from Windows to Linux)
* Macintosh: Run Sugar, School Server, any Linux
+
* [[Macintosh]]: Run Sugar, School Server, any Linux
* Linux on Linux: Fedora on Ubuntu and the like
+
* Linux on Linux: [[Fedora]] (including School Server) on [[Ubuntu]] and the like
* BSD does not have a version of qemu
+
* Sugar on Arm processors: Encore [[Mobilis]] and proposed [[olpc:XO-2|XO-2]]
 +
* BSD: qemu in development
   −
You can run almost any version of Sugar and the XS school server in qemu, including daily builds, releases, Sugar on a Stick, sugar-jhbuild, and whatever else we come up with. As we port Sugar to other computer architectures, such as ARM, this will become increasingly important, so that developers and testers do not have to purchase one of each.
+
You can run [[Emulator image files]] of almost any version of Sugar and the XS school server in qemu, including daily builds, releases, Sugar on a Stick, Live CDs, sugar-jhbuild, and whatever else we come up with. As we [[port Sugar]] to other computer architectures, such as ARM[[https://wiki.sugarlabs.org/go/Fedora_32#Rpi]], this will become increasingly important, so that developers and testers do not have to purchase one of each. There are emulation modules for qemu to emulate a wide range of processors and peripherals.
    
==Getting Started==
 
==Getting Started==
Line 21: Line 23:  
You should install an accelerator if at all possible, that is, if your processor supports virtualization in hardware. To find out whether it does, run the command
 
You should install an accelerator if at all possible, that is, if your processor supports virtualization in hardware. To find out whether it does, run the command
   −
  $ egrep (vmx|svm)/proc/cpuinfo
+
  $ egrep '(vmx|svm)' /proc/cpuinfo
 
  flags : fpu vme de pse tsc msr pae mce cx8 … vmx …
 
  flags : fpu vme de pse tsc msr pae mce cx8 … vmx …
 
  flags : fpu vme de pse tsc msr pae mce cx8 … vmx …
 
  flags : fpu vme de pse tsc msr pae mce cx8 … vmx …
Line 40: Line 42:     
You can run qemu on a variety of disk images, including .iso (CD image format), .img (raw disk images), .qcow2 (qemu Copy-On-Write).
 
You can run qemu on a variety of disk images, including .iso (CD image format), .img (raw disk images), .qcow2 (qemu Copy-On-Write).
 +
 +
===Creating disk images===
 +
 +
To create an empty, compressed, expandable hard drive image of 300 GB capacity, enter
 +
 +
$ qemu-img create my.img 300G
 +
 +
using the name of the image file you want to create. The file will be in qcow2 format unless you specify another option.
 +
 +
300 GB is what the School Server installation program wants. After installation, the image file will expand to 6.8 GB.
 +
 +
$ qemu-img info XS.img<br>
 +
image: XS.img<br>
 +
file format: qcow2<br>
 +
virtual size: 300G (322122547200 bytes)<br>
 +
disk size: 6.8G<br>
 +
cluster_size: 4096
 +
 +
To convert a read-only CD image such as the [[Sugar on a Stick]] Beta to read-write qcow2,
 +
 +
$ qemu-img convert -O qcow2 soas-beta.iso soas-beta.img
    
===Minimum Command===
 
===Minimum Command===
Line 49: Line 72:  
$ kvm -hda hda.img
 
$ kvm -hda hda.img
   −
where you will substitute the name of your .img, .iso, or other disk image file.
+
where you will substitute the name of your .img or other disk image file.
 +
 
 +
Similarly for .iso images such as a Sugar LiveCD.
 +
 
 +
$ kvm -cdrom cd.iso
   −
This may well boot your image and run, letting you log in and try out your software, assuming that your image file is valid. Depending on what your purpose is, you may prefer to add other options. For full details, consult the qemu documentation. Here are some examples.
+
This may well boot your image and run, letting you log in and try out your software, assuming that your image file is valid and your processor is not too old. Depending on what your purpose is, you may prefer to add other options. Here are some examples. For full details, consult the qemu documentation.
    
===Virtual Hardware===
 
===Virtual Hardware===
Line 58: Line 85:  
$ kvm -m 512 -soundhw es1370  -net user -net nic,model=rtl8139 -hda hda.img -hdb hdb.img -cdrom cd.iso
 
$ kvm -m 512 -soundhw es1370  -net user -net nic,model=rtl8139 -hda hda.img -hdb hdb.img -cdrom cd.iso
   −
===Install School Server===
+
===Install [http://wiki.laptop.org/go/School_server School Server]===
    
$ kvm -m 512 -hda hda.img -cdrom XS.iso
 
$ kvm -m 512 -hda hda.img -cdrom XS.iso
   −
Follow on-screen instructions. The process is almost completely automated. You will then have to set up networking to make this image accessible to jabber users and the like.
+
Pay attention to the boot sequence or it will just skip to its defaults. Press F12 when instructed to get to the boot menu, and tell it to boot from CD. Follow on-screen instructions. The process is almost completely automated. You will then have to set up networking to make this image accessible to jabber users and the like.
    
===Command Line===
 
===Command Line===
   −
This is actually a full terminal interface. It is good for remote servers, where you don't want to run X (too unstable) but you want to be able to log in with ssh to administer the system. This also lets you run full-screen text mode applications such as aptitude and Midnight Commander. Curses is named for the full-screen terminal cursor, which can be anywhere in a 24 × 80 field.
+
This is actually a full terminal interface. It is good for remote virtual servers, where you don't want to run X (too unstable) but you want to be able to log in with ssh to administer the system. This also lets you run full-screen text mode applications such as aptitude and Midnight Commander. Curses is named for the full-screen terminal cursor, which can be anywhere in a 24 × 80 field.
    
$ kvm -m 512 -curses -hda hda.img
 
$ kvm -m 512 -curses -hda hda.img
 +
 +
==qemu monitor==
 +
 +
The key combination Ctl-Alt-2 (not F2) transfers you from your running virtual machine to the qemu command line. This lets you query the system, save and load snapshots, and perform other administrative tasts. See the qemu documentation for available commands. Unfortunately the process of saving snapshots is not reliable. It may appear to work, but create a corrupted image.
    
==Resources==
 
==Resources==
   −
[http://www.nongnu.org/qemu/ QEMU home page]
+
* [http://www.nongnu.org/qemu/ QEMU home page]
[http://virtualize-it.highspeed-data.net/index.php/tag/kqemu/ more on KVM]
+
* [http://virtualize-it.highspeed-data.net/index.php/tag/kqemu/ more on KVM]
 +
* [[OLPC:QEMU]]
12,355

edits

Navigation menu