QEMU:如何在qemu仿真器上使用NFS挂载rootfs

时间:2023-01-26 21:43:29

QEMU:如何在qemu仿真器上使用NFS挂载rootfs - I build rootfs using busybox ,zimage using kernel source code. now i want to use NFS to read rootfs on qemu prompt can anybody tell me for arm as target and x86 as host machine.

- 我使用busybox,zimage使用内核源代码构建rootfs。现在我想使用NFS来读取qemu上的rootfs提示符可以任何人告诉我arm作为目标而x86作为主机。

1 个解决方案

#1


1  

1)Install nfs-kernel-server

1)安装nfs-kernel-server

sudo apt-get install nfs-kernel-server

2)create nfs folder where rootfs will be copied.

2)创建将复制rootfs的nfs文件夹。

mkdir -p /srv/nfs/
chown 1000:1000 /srv/nfs

3)edit the file /etc/exports

3)编辑文件/ etc / exports

/srv/nfs 127.0.0.1(rw,sync,no_subtree_check,all_squash,insecure,anonuid=1000,anongid=1000)

/ srv / nfs 127.0.0.1(rw,sync,no_subtree_check,all_squash,insecure,anonuid = 1000,anongid = 1000)

orif above does not works then try this

上面的orif不起作用然后尝试这个

/srv/nfs 127.0.0.1(rw,sync,no_subtree_check,no_root_squash,insecure)

/ srv / nfs 127.0.0.1(rw,sync,no_subtree_check,no_root_squash,insecure)

4)Run the command as root

4)以root身份运行命令

exportfs -av

exportfs -av

Copy the _install directory that is generated with Busybox build into the NFS share.

将使用Busybox build生成的_install目录复制到NFS共享中。

5)If you are not created rootfs properly follow this post for complete details http://balau82.wordpress.com/2010/04/27/linux-nfs-root-under-qemu-arm-emulator/

5)如果你没有正确创建rootfs,请关注这篇文章以获取完整的详细信息http://balau82.wordpress.com/2010/04/27/linux-nfs-root-under-qemu-arm-emulator/

6)run

6)运行

qemu-system-arm -M versatilepb -m 128M -kernel zImage -append "root=/dev/nfs nfsroot=10.0.2.2:/srv/nfs/_install rw ip=10.0.2.15::10.0.2.1:255.255.255.0 init=/sbin/init"

qemu-system-arm -M versatilepb -m 128M -kernel zImage -append“root = / dev / nfs nfsroot = 10.0.2.2:/ srv / nfs / _install rw ip = 10.0.2.15 :: 10.0.2.1:255.255.255.0 INIT = / sbin目录/初始化”

#1


1  

1)Install nfs-kernel-server

1)安装nfs-kernel-server

sudo apt-get install nfs-kernel-server

2)create nfs folder where rootfs will be copied.

2)创建将复制rootfs的nfs文件夹。

mkdir -p /srv/nfs/
chown 1000:1000 /srv/nfs

3)edit the file /etc/exports

3)编辑文件/ etc / exports

/srv/nfs 127.0.0.1(rw,sync,no_subtree_check,all_squash,insecure,anonuid=1000,anongid=1000)

/ srv / nfs 127.0.0.1(rw,sync,no_subtree_check,all_squash,insecure,anonuid = 1000,anongid = 1000)

orif above does not works then try this

上面的orif不起作用然后尝试这个

/srv/nfs 127.0.0.1(rw,sync,no_subtree_check,no_root_squash,insecure)

/ srv / nfs 127.0.0.1(rw,sync,no_subtree_check,no_root_squash,insecure)

4)Run the command as root

4)以root身份运行命令

exportfs -av

exportfs -av

Copy the _install directory that is generated with Busybox build into the NFS share.

将使用Busybox build生成的_install目录复制到NFS共享中。

5)If you are not created rootfs properly follow this post for complete details http://balau82.wordpress.com/2010/04/27/linux-nfs-root-under-qemu-arm-emulator/

5)如果你没有正确创建rootfs,请关注这篇文章以获取完整的详细信息http://balau82.wordpress.com/2010/04/27/linux-nfs-root-under-qemu-arm-emulator/

6)run

6)运行

qemu-system-arm -M versatilepb -m 128M -kernel zImage -append "root=/dev/nfs nfsroot=10.0.2.2:/srv/nfs/_install rw ip=10.0.2.15::10.0.2.1:255.255.255.0 init=/sbin/init"

qemu-system-arm -M versatilepb -m 128M -kernel zImage -append“root = / dev / nfs nfsroot = 10.0.2.2:/ srv / nfs / _install rw ip = 10.0.2.15 :: 10.0.2.1:255.255.255.0 INIT = / sbin目录/初始化”