Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

kvm/qemu virtual machine can't find hard drives

2,432 views
Skip to first unread message

Gary Roach

unread,
Aug 17, 2017, 1:10:06 PM8/17/17
to
Hi all,

Debian 9 (Stretch) system
KDE Desktop
MSI970A-G43 motherboard
AMD FX 4350 processor - not overclocked

Ive been trying to get a virtual machine set up and have run into
problems with both virtualbox and kvm/qemu packages. I have a very messy
project (Elmer fem) and want things completely walled off from my
regular system. So I opted for a virtual machine.

The kvm/qemu package seems to install properly (no errors). But when I
try to install Debian 9 into it, the installer can't find my two hard
drives sda and sdb. It then ask me to pick from a long list of drivers.
I haven't been able to determine what the drivers should be for my
system. Sda is boot drive, 500 Gb WD160 and the there is a WD10 1 Tb,
ext4 blank drive. Both drives show up on Dolphin so they must be mounted.

Am I missing some library or something? Any help will be greatly
appreciated.

Gary R.

Mario Castelán Castro

unread,
Aug 17, 2017, 1:20:06 PM8/17/17
to
Have you passed the appropriate options to QEMU? You *must* use “-drive
file=...”. For example “-drive file=/dev/sda”. Read the QEMU manual for
details. QEMU does not gives the the guest is access to host devices by
default; that would be a very high security risk.
signature.asc

Dejan Jocic

unread,
Aug 17, 2017, 1:30:06 PM8/17/17
to
Can you explain steps you used to get to that error message? Think that
you've messed something up in installation process, because installer on
virtual machine should not care about your physical drives, it uses
virtual drives that you've assigned to it. In case that you would like
easy to use install process for qemu-kvm, I would suggest you to install
virt-manager, that is GUI frontend for managing virtual machines.

Bob Weber

unread,
Aug 17, 2017, 2:00:07 PM8/17/17
to
Usually the qemu vm runs from a file (created by qemu-img) set up as a disk
drive by qemu.  I use Virtual Machine Manager (along with libvirtd) which can do
all the hard stuff for you.  I usually make my own virtual drive files with
qemu-img and let Virtual Machine Manager control access to them.  libvirtd does
a good job of letting you run qemu from your user account and access the
necessary resources on the host machine.  libvirtd sets up all the network
devices and bridges needed to access the real world. Virtual Machine Manager can
connect to USB devices on the host machine, manage CD drive access (either to
hardware cd drive or iso images ... like an install image), boot devices
(usually the sda drive or cd drive), the amount of memory for each vm and
additional drive you may want (like to try multi disk raid).   Virtual Machine
Manager opens up a vnc (or spice) window where you can see the output from the
vm when it is running on your kde desktop .. either text mode or graphical
mode.  I have about 15 vm's defined.  One runs debian with kde to handle my
weather station.  Another runs win 10 (ug) so I can do my taxes.  Most of the
others are debian and kde testing and unstable installs that I use to test
updates before I commit them to my host desktop machine.

Most debian installs work easily with a 20 or 20 GB virtual drive.  You create
the file necessary with a command like this:

qemu-img create -f qcow2 /home/img/Mymachine/drive.img 30G

This assumes that /home is mounted on your 1TB drive.  Looks like the packages
to get you started are libvirt-daemon-system and virt-manager.

Hope this helps.

...bob

Richard Hector

unread,
Aug 17, 2017, 9:40:05 PM8/17/17
to
On 18/08/17 13:12, Gary Roach wrote:
> On 08/17/2017 10:50 AM, Bob Weber wrote:
>> Looks like the packages
>> to get you started are libvirt-daemon-system and virt-manager.
>>
>> Hope this helps.
>>
>> ...bob
>>
>>
>>
> Sorry bob but the debian 9 archives doesn't include libvirtd or
> anything equivalent.

libvirtd is in libvirt-daemon, which libvirt-daemon-system depends on. I
have those on a Debian 9.1 vm host.

Richard

signature.asc

Phil Wyett

unread,
Aug 17, 2017, 9:40:05 PM8/17/17
to
On Thu, 2017-08-17 at 18:12 -0700, Gary Roach wrote:
> On 08/17/2017 10:50 AM, Bob Weber wrote:
> Sorry bob but the  debian 9 archives doesn't include libvirtd or 
> anything equivalent. I have been trying to use virt-manager but have 
> gotten a bit confused. The screen shot is attached. I have two hard 
> drives. One is a 160 Gb boot drive called bootdisk and another empty 1 
> Tb drive called bigdisk. It looks like virt-manager picked the empty 1Tb 
> drive and only allocated 20 Gb to the program. I hit the Volumes + but 
> didn't see any way to add the boot drive. Are we talking about a virtual 
> drive that is situated in the bigdisk. Is the guest OS situated in the 
> bigdisk. If so, this is not a bad thing since I will probably have 
> massive amounts of data produced. But I do need to figure out what I am 
> dealing with.
>
> Any help will be appreciated.
>
> Gary R.

Hi,

Recap. You have two HDDs:

[1] One 160GB with the OS on so '/'.
[2] Second 1TB.

Correct?

Does [2] get mounted as '/home' or are you using it as a extra data drive? How
are you mounting it in '/etc/fstab'?

You can use the command 'df -h' in the terminal to see mount points.

If [1] is the OS drive as you suggest, the VM HDD is on there. Look at the
screenshot. There is a default pool for VM disk images at
'/var/lib/libvirt/images' and that is where you created the 20GB image.

Regards

Phil

--
*** If this is a mailing list, I am subscribed, no need to CC me.***

Playing the game for the games sake.

Web: https://kathenas.org

Twitter: kathenasorg

Instagram: kathenasorg
signature.asc

Cindy-Sue Causey

unread,
Aug 17, 2017, 9:50:05 PM8/17/17
to
On 8/17/17, Gary Roach <gary71...@verizon.net> wrote:
> On 08/17/2017 10:50 AM, Bob Weber wrote:
>>
>> Most debian installs work easily with a 20 or 20 GB virtual drive. You
>> create
>> the file necessary with a command like this:
>>
>> qemu-img create -f qcow2 /home/img/Mymachine/drive.img 30G
>>
>> This assumes that /home is mounted on your 1TB drive. Looks like the
>> packages
>> to get you started are libvirt-daemon-system and virt-manager.
>>
>>
> Sorry bob but the debian 9 archives doesn't include libvirtd or
> anything equivalent. I have been trying to use virt-manager but have
> gotten a bit confused. The screen shot is attached. I have two hard
> drives. One is a 160 Gb boot drive called bootdisk and another empty 1
> Tb drive called bigdisk. It looks like virt-manager picked the empty 1Tb
> drive and only allocated 20 Gb to the program. I hit the Volumes + but
> didn't see any way to add the boot drive. Are we talking about a virtual
> drive that is situated in the bigdisk. Is the guest OS situated in the
> bigdisk. If so, this is not a bad thing since I will probably have
> massive amounts of data produced. But I do need to figure out what I am
> dealing with.
>
> Any help will be appreciated.


Try dropping the "d" with your searches. It's a trick I learned from
lurking. If I can't find something you all write about, I start
chopping the suggestion into pieces. I just found a few files with
"libvirt" instead of "libvirtd", and they're mentioning virtual
machines.

You know what, I just found something with the "libvirtd", too:
libvirt-daemon. Maybe it's not in Stretch? Both were in Buster. :)

Here it is:

https://packages.debian.org/stretch/libvirt-daemon

There's a typo there if someone wants to have at it. The author
apparently wanted to make sure they got that "e" on the right side of
that "a", whichever side that was supposed to be.... :)

This is a great conversation. I've been wanting to try this, but I
keep forgetting. It's a large pain to keep updated when you've never
used it. We're talking *years* of never used. :D

Cindy :)
--
Cindy-Sue Causey
Talking Rock, Pickens County, Georgia, USA

* runs with duct tape *

Dejan Jocic

unread,
Aug 18, 2017, 4:10:05 AM8/18/17
to
On 17-08-17, Gary Roach wrote:
> Sorry bob but the debian 9 archives doesn't include libvirtd or anything
> equivalent. I have been trying to use virt-manager but have gotten a bit
> confused. The screen shot is attached. I have two hard drives. One is a 160
> Gb boot drive called bootdisk and another empty 1 Tb drive called bigdisk.
> It looks like virt-manager picked the empty 1Tb drive and only allocated 20
> Gb to the program. I hit the Volumes + but didn't see any way to add the
> boot drive. Are we talking about a virtual drive that is situated in the
> bigdisk. Is the guest OS situated in the bigdisk. If so, this is not a bad
> thing since I will probably have massive amounts of data produced. But I do
> need to figure out what I am dealing with.
>
> Any help will be appreciated.
>
> Gary R.

Package you want is libvirt-bin and libvirt-daemon-system and
libvirt-clients come as dependences with it. Most of the guides around,
including debian wiki guide about qemu-kvm tell you to install those.
Package bridge-utils too. I see that you talk again about your hard
drives. That is wrong because because virt-manager and libvirt do not
care about your hard drives, it cares about storages and storage
volumes. Default storage volume is at /var/lib/libvirt/images. But I
guess that you do not want your image there, most people do not.
Creating image with virt-manager is as easy as following 5 steps, after
you launch it, click FIle and select create new virtual machine:

1. Choose how you would like to install. Will guess that you have local
install media in form of downloaded ISO. Pick it up, do not touch
architecture options, if you do not need them. Click forward.

2. Use ISO image and click browse. Use browsing to find your download
location. Choose your ISO image. It should automatically detect that it
is debian stretch. Forward.

3. Choose CPU and memory settings. Forward.

4. Enable storage for this virtual machine checked. Choose Select or
create custom storage. Click Manage... Use + signs to make new volume
and storage for your image where you want it, or choose existing one.
You have there options to choose max capacity for it, but no worries, it
can be expanded, it is virtual machine. Use qcow2 format. I have no need
for backing store, but see for yourself if you want it. Finish. Choose
that volume that you've made. Forward.

5. Read to begin the installation screen. You can customize
configuration before install, if you want. By default, on my laptop and
without changing anything in network files, network selection is not
needed, it will choose virtual network 'default' and work out of the
box. Finish and install will start in new window.




5.

Gary Roach

unread,
Aug 18, 2017, 4:10:06 PM8/18/17
to
I really appreciate all of you quick responses.

For some unknown reason, when I searched the Debian database virt came
up empty. This time it didn't. So, at this point, its go RTFM.

The manual will probably clear it up but When trying to run
virt-manager, I did get the following error:

unable to complete install: 'unsupported configuration: CPU mode
'custom' for x86_64 kvm domain on x86_64 host is not supported by
hypervisor'

Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 88, in
cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/create.py", line 2288, in
_do_async_install
guest.start_install(meter=meter)
File "/usr/share/virt-manager/virtinst/guest.py", line 461, in
start_install
doboot, transient)
File "/usr/share/virt-manager/virtinst/guest.py", line 396, in
_create_guest
self.domain = self.conn.createXML(install_xml or final_xml, 0)
File "/usr/lib/python2.7/dist-packages/libvirt.py", line 3523, in
createXML
if ret is None:raise libvirtError('virDomainCreateXML() failed',
conn=self)
libvirtError: unsupported configuration: CPU mode 'custom' for x86_64
kvm domain on x86_64 host is not supported by hypervisor

I'll give things another try and may be back later. If not, thanks again.

Gary R

Dejan Jocic

unread,
Aug 18, 2017, 4:30:06 PM8/18/17
to
Do this:

grep -E -c '(vmx|svm)' /proc/cpuinfo

if you get 0, your CPU does not support virtualisation with KVM. If you
get more than zero, make sure that virtualisation is enabled in your
BIOS settings.

Bob Weber

unread,
Aug 18, 2017, 5:10:06 PM8/18/17
to
According to AMD the FX series cpu supports AMD Virtualization™ (AMD-V™)
Technology with IOMMU so it must be turned off in the BIOS so check there.


...bob

Gary Roach

unread,
Aug 20, 2017, 10:50:05 PM8/20/17
to
Hi all

I finally got kvm up and running with Debian 9 installed. Per Bob Weber,
I seem to have missed one of about 5 must have packages. Once up, I had
the problem of getting my network printer to work. Cups must be
installed and to get the proper drivers for my printer, I needed to
install hplip an hpcups libraries. After that I fired up the web browser
to localhost:631 and the rest was easy. Now off to Elmer FEM land for
another F****** learning experience.

Thank everyone for you help and support.

Gary R
0 new messages