File:  [NetBSD Developer Wiki] / wikisrc / tutorials / how_to_setup_virtio_scsi_with_qemu.mdwn
Revision 1.3: download - view: text, annotated - select for diffs
Mon Nov 2 16:56:57 2015 UTC (4 years, 8 months ago) by wiki
Branches: MAIN
CVS tags: HEAD
web commit by christos

    1: You need NetBSD-current post 2015-10-30 to use VirtIO SCSI.
    2: 
    3: ## Kernel configuration
    4: Make sure you have the following lines in your kernel configuration:
    5: 
    6:         virtio* at pci? dev ? function ?        # Virtio PCI device
    7:         vioscsi* at virtio?                     # Virtio SCSI device
    8: 
    9: ## QEmu setup
   10: 1. Create 2 files one for the installation, and one for the test SCSI drive:
   11: 
   12:         dd if=/dev/zero of=install.img seek=10m count=1
   13:         dd if=/dev/zero of=test.img seek=10m count=1
   14: 
   15: 2. Start QEmu pointing it to your installation serial console cdrom:
   16: 
   17:         qemu-system-x86_64 \
   18:             -m 1024 \
   19:             -nographic \
   20:             -drive file=install.img,media=disk,snapshot=off,format=raw \
   21:             -drive file=boot-com.iso,media=cdrom
   22: 
   23:    Install as usual, choosing serial boot blocks
   24: 
   25: 3. Once you are done installing you can boot QEmu from your install.img
   26:    you just populated in step 2, and the test.img you created on step 1
   27:    as your virtio sd0 disk as follows:
   28: 
   29:         qemu-system-x86_64 \
   30:             -m 1024 \
   31:             -k en-us \
   32:             -nographic \
   33:             -drive file=install.img,media=disk,snapshot=off,format=raw \
   34:             -device virtio-scsi-pci,id=scsi \
   35:             -device scsi-hd,drive=hd \
   36:             -drive if=none,id=hd,file=test.img,format=raw \
   37:             -net nic,macaddr=ba:be:00:fa:ce:01,model=virtio \
   38:             -net user,hostfwd=tcp::2003-:22 \
   39:             -boot c
   40: 

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb