Coder Social home page Coder Social logo

malw2020 / nvmeqemu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nvmeqemu/nvmeqemu

0.0 2.0 0.0 38.17 MB

NVM Express Device Emulation in QEMU

License: Other

Makefile 0.23% Python 0.08% C 95.75% C++ 1.46% Haxe 0.77% Objective-C 0.35% Assembly 0.55% Perl 0.67% Shell 0.13% GDB 0.01%

nvmeqemu's Introduction

1. Introduction
2. How to compile Qemu with NVME support.
3. Make a virtual HD for QEMU
4. Locate and download a Linux based 64b OS to virtualize
5. Install KVM
6. Install the chosen virtualized OS to the virtual HD
7. Boot the virtual machine from the virtual HD
8. Performance notes
9. Usage Notes


Qemu for NVME.

1. Introduction.

To get more details about Qemu visit the official website:
http://wiki.qemu.org/Main_Page

To clone Qemu with support for NVME clone source code from:
git clone [email protected]:nvmeqemu/nvmeqemu.git

2. How to compile Qemu with NVME support.
    a. Clone the above git repository.
    b. Make sure you are using a 64 bit environment and a 64 bit Linux kernel.
    c. You need the following libraries:
       For Ubuntu 10.10 Server 64b host:
           sudo apt-get install linux-headers-2.6.35-22-server
           sudo apt-get install zlib1g-dev
           sudo apt-get install libsdl-dev
           sudo apt-get install libaio-dev

       For RHEL5 host (If the packages are not found, check your repositories' setup):
           yum install kernel-devel
           yum install zlib-devel
           yum install SDL
           yum install libaio-devel
       ./configure --enable-io-thread --enable-linux-aio --target-list=x86_64-softmmu --enable-sdl
       NOTE: With RHEL5 the configure might fail, complaining about AIO even after installing it. Ignore it and re-run configure with the AIO switch removed from the command

       make

    d. The resulting executable is qemu/x86_64-softmnu/qemu-system-x86_64/qemu-system-x86_64. You can add it to $PATH for easy access.

3. Make a virtual HD for QEMU
    1. On RHEL5:
       yum install qemu-img

    2. Execute
       qemu-img create -f raw <your_virtual_HD_filename.img> <size>M

4. Locate and download a Linux based 64b OS to virtualize
    1. Download the iso file and save as <your_iso_image_filename.iso>

5. Install KVM

    1. On RHEL5:
       yum install kvm kmod-kvm

6. Install the guest OS to the virtual HD
   1. Execute
      ./qemu-system-x86_64 -m 1024 -cdrom <path_to_your_iso_image>/<your_iso_image_filename.iso> -hda <path_to_virtual_HD>/<your_virtual_HD_filename.img> -device nvme -boot d
          A terminal window should launch into view booting from the supplied ISO file.
          Follow through the usual actions to install the OS onto the virtual HD.
          Feel free to partition/format/re-initialize virtual HD as necessary.
          At the end of a successful installation reboot the virtual machine.

7. Boot the virtual machine from the virtual HD
    1. Execute with kvm support (recommended)
       sudo ./qemu-system-x86_64 -m 1024 -hda <path_to_virtual_HD>/<your_virtual_HD_filename.img> -device nvme --enable-kvm -smp 2
    2. Execute without kvm support
       sudo ./qemu-system-x86_64 -m 1024 -hda <path_to_virtual_HD>/<your_virtual_HD_filename.img> -device nvme -smp 2

8. Performance notes
    1. Consider adding the following switches when invoking configure:
    --enable-io-thread --enable-linux-aio
    2. Consider adding the following switches when invoking qemu:
    --enable-kvm -smp 2

9. Usage Notes
    1. Config Files
           NVME module of Qemu uses two device config files called "NVME_device_PCI_config" and "NVME_device_NVME_config" located inside the /qemu/hw directory
           They basically enable the user to set up the intial values in both the PCI and NVME config space
           These file names are unique and thus there should not be multiple files with the above names inside the directory from where the qemu is run by executing Step 6
           Program should be executed from an higher level directory so that both the config files are available inside the directory itself else both spaces will be initialized to
           defaulted values
    2. Additional command line options:
            You can configure the number of namespaces and their sizes from the command line. The options are: namespaces=<number_of_namespaces> and size=<size_in_MB>. These options go after the "-device namespace". Example
            sudo ./qemu-system-x86_64 -m 1024 -hda <path_to_virtual_HD>/<your_virtual_HD_filename.img> -device,namespace=1,size=1024 nvme -smp 2
            The program limits the number of namespaces to 16 per device and 8GB in size. There will be 1 namespace of 512 MB by default if no opt

            Full list of -device nvme options:
            namespaces=<number_of_namespaces>  : the maximum number of namespaces the device can have.
            size=<size_in_MB>                  : size each automatically created namespace will be.

nvmeqemu's People

Contributors

blueswirl avatar kraxel avatar jan-kiszka avatar aurel32 avatar kevmw avatar rth7680 avatar mstsirkin avatar bonzini avatar pm215 avatar markmc avatar agraf avatar edgarigl avatar nisheethbhat avatar i-garrison avatar matosatti avatar iksaif avatar awilliam avatar mwalle avatar afaerber avatar avikivity avatar aprzywar avatar lumag avatar dgibson avatar jwrdegoede avatar filipnavara avatar kiryl avatar balrog-kun avatar anthonyper-ctx avatar kvaneesh avatar vivier avatar

Watchers

James Cloos avatar maliwei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.