Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

[SOLVED] Attaching hard drive as virtio-scsi on QEMU

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
2 posts • Page 1 of 1
Author
Message
imieinazwisko
n00b
n00b
Posts: 54
Joined: Thu Feb 13, 2020 2:40 am

[SOLVED] Attaching hard drive as virtio-scsi on QEMU

  • Quote

Post by imieinazwisko » Fri Jul 31, 2020 3:19 am

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: Select all

    -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: Select all

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: Select all

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.
Top
imieinazwisko
n00b
n00b
Posts: 54
Joined: Thu Feb 13, 2020 2:40 am

  • Quote

Post by imieinazwisko » Sat Aug 01, 2020 9:16 pm

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.
Top
Post Reply

2 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic