Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Attaching hard drive as virtio-scsi on QEMU
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
imieinazwisko
n00b
n00b


Joined: 13 Feb 2020
Posts: 38

PostPosted: Fri Jul 31, 2020 3:19 am    Post subject: [SOLVED] Attaching hard drive as virtio-scsi on QEMU Reply with quote

I'm trying to attach one of my hard drives to my VM through QEMU. I've been able to attach hard drives fine using ide-hd but I have read that scsi is faster so I'm trying to get that working. Following the Gentoo Wiki on virtio-scsi I added the following three lines to my QEMU script:
Code:
    -device virtio-scsi-pci,id=scsi0 \
    -drive file=/dev/sda,id=slon,format=raw,if=none,discard=unmap,aio=native,cache=none \
    -device scsi-hd,drive=slon,bus=scsi0.0 \

When I boot up Win10 there is a SCSI device in the removable device menu but the hard drive does not see to be attached. The hard drive is functional. It's mounted under Gentoo just fine. It's NTFS formatted so there shouldn't be any file system incompatibilities. Checking fdisk
Code:
Disk /dev/sda: 1.84 TiB

That is also the correct drive. Is something wrong with my syntax or is there something else I need to look at? Below is my entire QEMU script in case there's something else that is interfering.

Code:
exec qemu-system-x86_64 \
    -enable-kvm -m 16384 -cpu host,kvm=off \
    -smp 6,sockets=1,cores=6,threads=1 \
    -device vfio-pci,host=07:00.0,x-vga=on  \
    -device vfio-pci,host=07:00.1 \
    -vga none\
    -drive file=/home/user/VirtualMachines/Win10/Win10.qcow2,id=disk,format=qcow2,if=none \
    -device ide-hd,bus=ide.0,drive=disk \
    -boot menu=on \
    -usb \
    -device virtio-serial \
    -spice port=5900,addr=127.0.0.1,disable-ticketing \
    -device usb-host,vendorid=0x413c,productid=0x2003,id=keyboard \
    -device usb-host,vendorid=0x046d,productid=0xc537,id=mouse \
    -device usb-host,vendorid=0x0d8c,productid=0x0005,id=microphone \
    -drive file=/dev/sdb,id=storage,format=raw,if=none \
    -device ide-hd,bus=ide.1,drive=storage \
    -device virtio-scsi-pci,id=scsi0 \
    -drive file=/dev/sda,id=slon,format=raw,if=none,discard=unmap,aio=native,cache=none \
    -device scsi-hd,drive=slon,bus=scsi0.0 \
    -device ivshmem-plain,memdev=ivshmem,bus=pci.0 \
    -object memory-backend-file,id=ivshmem,share=on,mem-path=/dev/shm/looking-glass,size=32M \
    -mem-path /dev/hugepages
    $@


Last edited by imieinazwisko on Sun Aug 02, 2020 12:42 am; edited 1 time in total
Back to top
View user's profile Send private message
imieinazwisko
n00b
n00b


Joined: 13 Feb 2020
Posts: 38

PostPosted: Sat Aug 01, 2020 9:16 pm    Post subject: Reply with quote

Alright I figured this one out. My syntax is correct. What needs to be done is install the correct scsi driver on the windows side. Go to this fedora site and get the iso and the driver is in there. I also installed app-emulation/virtio-win in portage. I'm not sure if that last part is necessary or not.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum