4.6. Running Under a Network File System (NFS) Server

One method for running QEMU is to run it on an NFS server. This is useful when you need to access the same file system from both the build and the emulated system at the same time. It is also worth noting that the system does not need root privileges to run. It uses a user space NFS server to avoid that. Follow these steps to set up for running QEMU using an NFS server.

  1. Extract a Root Filesystem: Once you are able to run QEMU in your environment, you can use the runqemu-extract-sdk script, which is located in the scripts directory along with the runqemu script.

    The runqemu-extract-sdk takes a root filesystem tarball and extracts it into a location that you specify. Here is an example that takes a file system and extracts it to a directory named test-nfs:

         runqemu-extract-sdk ./tmp/deploy/images/qemux86/core-image-sato-qemux86.tar.bz2 test-nfs
                        

  2. Start QEMU: Once you have extracted the file system, you can run runqemu normally with the additional location of the file system. You can then also make changes to the files within ./test-nfs and see those changes appear in the image in real time. Here is an example using the qemux86 image:

         runqemu qemux86 ./test-nfs
                        

Note

Should you need to start, stop, or restart the NFS share, you can use the following commands:

  • The following command starts the NFS share:

         runqemu-export-rootfs start file-system-location
                                

  • The following command stops the NFS share:

             runqemu-export-rootfs stop file-system-location
                                

  • The following command restarts the NFS share:

         runqemu-export-rootfs restart file-system-location