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 (5 years, 4 months ago) by wiki
Branches: MAIN
CVS tags: HEAD
web commit by christos

You need NetBSD-current post 2015-10-30 to use VirtIO SCSI.

## Kernel configuration
Make sure you have the following lines in your kernel configuration:

        virtio* at pci? dev ? function ?        # Virtio PCI device
        vioscsi* at virtio?                     # Virtio SCSI device

## QEmu setup
1. Create 2 files one for the installation, and one for the test SCSI drive:

        dd if=/dev/zero of=install.img seek=10m count=1
        dd if=/dev/zero of=test.img seek=10m count=1

2. Start QEmu pointing it to your installation serial console cdrom:

        qemu-system-x86_64 \
            -m 1024 \
            -nographic \
            -drive file=install.img,media=disk,snapshot=off,format=raw \
            -drive file=boot-com.iso,media=cdrom

   Install as usual, choosing serial boot blocks

3. Once you are done installing you can boot QEmu from your install.img
   you just populated in step 2, and the test.img you created on step 1
   as your virtio sd0 disk as follows:

        qemu-system-x86_64 \
            -m 1024 \
            -k en-us \
            -nographic \
            -drive file=install.img,media=disk,snapshot=off,format=raw \
            -device virtio-scsi-pci,id=scsi \
            -device scsi-hd,drive=hd \
            -drive if=none,id=hd,file=test.img,format=raw \
            -net nic,macaddr=ba:be:00:fa:ce:01,model=virtio \
            -net user,hostfwd=tcp::2003-:22 \
            -boot c


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