How does nfs start Linux? We all know that NFS is widely used and has been widely used in Linux. Linux is developing fast, and many people begin to learn. When studying Linux, you may encounter Linux system problems. Here we will introduce how to use qemu to start Linux through nfs. Here we will share with you. I hope you can learn how to start Linux through nfs in qemu. Assume that the development machine is installed with Fedora 9
1. Set network-enable qemu to use the network of the Development Machine
First, confirm that TUN is configured in the kernel of the development machine.
Grep CONFIG_TUN =/boot/config-'uname-R'
Normally, CONFIG_TUN = m OR = y
2. Install the network configuration tool
- yum install bridge-utils
3. Configure the network
- /usr/sbin/brctl addbr br0
- /sbin/ifconfig eth0 0.0.0.0 promisc up
- /usr/sbin/brctl addif br0 eth0
- /sbin/dhclient br0
- /sbin/iptables -F FORWARD
4. Fedora 9 configure the Network File System
Assume that the directory of the Network File System is/mnt/arm-nfs
Add the following to/etc/export:
/Mnt/arm-nfs/* (rw, sync, no_root_squash)
Start the Network File System Service
/Sbin/service nfs restart
5. Prepare the qemu STARTUP script, save the following code as qemu-ifup, and set the Execution Mode chmod + x qemu-ifup.
- #!/bin/sh
- /sbin/ifconfig $1 0.0.0.0 promisc up
- /usr/sbin/brctl addif br0 $1
6. Kernel configuration
- CONFIG_IP_PNP_DHCP=y
- CONFIG_TUN=y
- CONFIG_AEABI=y
- CONFIG_TMPFS=y
7. Start qemu
- qemu-system-arm -M YourMachine -kernel zImage root="/dev/nfs nfsroot=
- -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=./qemu-ifup
You can use the above methods to start Linux using nfs for qemu.