Qemu simulation sparc32

Source: Internet
Author: User

1. $ wget http://wiki.qemu-project.org/download/qemu-1.4.1.tar.bz2

2. $ tar-xjf qemu-1.4.1.tar.bz2

3. $ CD qemu-1.4.1

$./Configure

# Make install

4. $ qemu-sparc64-version

Qemu-sparc64 version 1.4.1, copyright (c) 2003-2008 Fabrice bellard

5. Create a disk image

$ Mkdir spark

$ CD spark

$ Qemu-IMG create-F qcow hda. IMG 40g

Because the qcow format is used, all non-empty sectors are written into the file. Therefore, the disk file is small.

$ Du-H hda. img

6. Obtain the spark kernel Image

Currently, there is a problem with the latest Debian support.

// The Last Debian release to support sparc32 (sun4m) was etch (4.0)

$ Http://cdimage.debian.org/cdimage/archive/4.0_r9/sparc/iso-cd/debian-40r9-sparc-netinst.iso

7. Install Debian

$ Qemu-system-iSCSI-hda. IMG-CDROM debian-40r9-sparc-netinst.iso-boot d

The boot option specifies to boot from the CD-ROM. Parameter d specifies the boot from the CD-ROM, where a specifies the boot from the floppy disk, c

Specify boot from the hard disk (default), while n specify boot from the network.



8. Start the system

$ Qemu-system-iSCSI-hda. IMG-boot C

9. Configure the network

-Make sure that config_tun is configured on the host kernel.

$ Grep config_tun/boot/config-'uname-R'

# Config_tun = m/config_tun = y

-Load the Tun Module

# Modprobe Tun

-Ensure that config_bridge is configured for the host kernel.

-Modify the network configuration file/etc/Network/interfaces of the host.

Static Configuration:

Auto br0

Iface br0 Inet static

Address 192.168.2.254

Network 192.168.2.0

Netmask 255.255.255.0

Broadcast 192.168.2.255

Gateway 192.168.2.1

Bridge_ports eth0

Dynamic Configuration:

Auto br0

Iface br0 Inet DHCP

Bridge_ports eth0

Bridge_maxwait 0



-Install required tools

# Apt-Get install bridge-utils

-Restart the network.

#/Etc/init. d/networking restart

-Create a script/etc/qemu-IFUP, which is automatically executed when qemu is started.

#! /Bin/sh

Echo "executing/etc/qemu-IFUP"

Echo "bringing up $1 for bridged mode ..."

Sudo/sbin/ifconfig $1 0.0.0.0 promisc up

Echo "adding $1 to br0.0 ..."

Sudo/usr/sbin/brctl addif br0 $1

Sleep 2

In fact, it is to add tap0 to br0 (Bridge, which can be considered as a hub with multiple ports.



10. Start qemu

# Qemu-system-iSCSI-hda. IMG-net Nic, macaddr = 00: 16: 3E: 00: 00: 01-net tap



11. Configure the network in qemu

# Ifconfig eth1 192.168.1.123 up

// According to the IP address of br0 in the host, my IP address is br0 192.168.1.101

Ping host

# Ping 192.168.1.101

Ping qemu from the host

# Ping 192.168.1.123



If the configuration is normal, you can access each other.

12. qemu connected to the Internet



-Set host

Enable the host forwarding function to ensure that the/proc/sys/NET/IPv4/ip_forward value is 1.

-??? What is the function ???

# Iptables-T Nat-A postrouting-J Masquerade



-Now you can ping the Internet IP address.

# Ping 119.75.217.56

-Configure domain name resolution

Write the content in/etc/resolv. conf under the host to/etc/resolv. conf of the qemu VM.

Now, you can ping the Internet domain name.

# Ping www.baidu.com

13. If you need to install other software, you can copy the installation from the pool in the debian-40r9-sparc-netinst.iso.

# Mount-o loop debian-40r9-sparc-netinst.iso/mnt

 

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.