Install qemu in SuSE10.0

Source: Internet
Author: User
Install qemu-general Linux technology-Linux programming and kernel information under SuSE10.0. For details, refer to the following section. 1. Compile qemu
Compiling qemu with SuSE10.0's built-in gcc-4.0.2 will cause the following problems
# Cd/usr/local/qemu-0.9.0
#./Configure
WARNING: "gcc" looks like gcc 4.x
Looking for gcc 3.x
Gcc 3.x not found!
QEMU is known to have problems when compiled with gcc 4.x
It is recommended that you use gcc 3.x to build QEMU
To use this compiler anyway, configure with -- disable-gcc-check
So you can first install a gcc-3.4.6
# Which gcc
/Usr/local/bin
# Gcc -- version
Gcc (GCC) 3.4.6
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
Warranty; not even for MERCHANTABILITY or fitness for a particle PURPOSE.
# Cd/usr/local/qemu-0.9.0
#./Configure; make install

2. Compile kqemu
If you still compile kqemu with a gcc-3.4.6, the following issues will occur during module insertion:
# Modprobe kqemu
FATAL: Error inserting kqemu (/lib/modules/2.6.13-15-smp/misc/kqemu. ko): Invalid module format
Therefore, when compiling kqemu, use the gcc-4.0.2 that comes with the system.
# Which gcc
/Usr/bin/gcc
# Gcc -- version
Gcc (GCC) 4.0.2 20050901 (prerelease) (SUSE Linux)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
Warranty; not even for MERCHANTABILITY or fitness for a particle PURPOSE.
# Cd/usr/local/qemu-0.9.0/kqemu-1.3.0pre11
#./Configure; make install
# Modprobe kqemu
# Lsmod | grep kqemu
Kqemu 128548 0
# Modinfo kqemu
Filename:/lib/modules/2.6.13-15-smp/misc/kqemu. ko
License: GPL
Vermagic: 2.6.13-15-smp SMP 586 REGPARM gcc-4.0
Depends:
Parm: major: int

3. Network Settings
# Qemu-cd rom slax-5.1.8.1.iso
After the slax boot disk is used, slax will get an ip address 10.0.2.15, your SuSE10.0 will be 10.0.2.2 by default, and the ip address of the Domain Name Server will be 10.0.2.3. You can connect to SuSE10.0 through ssh
# Ssh 10.0.2.2
If windows is virtualized, Type
\ 10.0.2.2
You can exchange files through samba and SuSE10.0.

4. Disk operations
# Qemu-img create win. img 10G
# Qemu-hda win. img-cdrom TomatoWinXP_SP2_v3_0.iso-boot d-m 384
The following describes how to mount an image file to a local device through a loopback device to directly interact with the local file system.

# Losetup/dev/loop0 win. img
# Fdisk/dev/loop0

The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
And coshould in certain setups cause problems:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(E.g., dos fdisk, OS/2 FDISK)

Command (m for help): x

Expert command (m for help): p

Disk/dev/loop0: 255 heads, 63 sectors, 2610 cylinders

Nr AF Hd Sec Cyl Start Size ID
1 80 1 1 0 254 63 568 63 9140922 0b
2 00 0 0 0 0 0 0 0 00
3 00 0 0 0 0 0 0 0 00
4 00 0 0 0 0 0 0 0 00

Expert command (m for help): q

# Losetup-o 32256/dev/loop1 win. img
# Mount-t vfat/dev/loop1 win
# Cd win
# Ls
Parameters and Settings autoexec. bat config. sys io. sys ntldr
Program Files boot. ini found.000 msdos. sys pagefile. sys
Recycled bootfont. bin hiberfil. sys ntdetect.com windows

32256 is calculated using start * 512. In this example, start = 63
After copying the file, do not forget to clear it.
# Losetup-
/Dev/loop0: [0302]: 241 (win. img)
/Dev/loop1: [0302]: 241 (win. img) offset = 32256
# Umount win
# Losetup-d/dev/loop0
# Losetup-d/dev/loop1

The above operations are explained in more detail in the electronic version of "Linux kernel full notes" provided by Zhao Ke.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.