kvm use entire disk device

Is it possible when creating a virtual machine with virt-install to specify the --disk flag with something like /dev/sdc (assuming a hard drive on my host is at that location) instead of mapping it to a .img file? currently my command looks like:

sudo virt-install --name ubuntu-test \  --ram 512 --vcpus 1 \  --disk path=/home/username/test.img,size=10 \  --location http://mirror.facebook.net/ubuntu/dists/xenial/main/installer-  amd64 \  --graphics none 

can i change it to something like?:

sudo virt-install --name ubuntu-test7 \  --ram 512 --vcpus 1 \  --disk path=/dev/sdc \  --location http://mirror.facebook.net/ubuntu/dists/xenial/main/installer-  amd64 \  --graphics none \ 

Thanks

Replay

Yes, this works just fine.

In my case I use LVM created devices and I was able to install Kali Linux in a VM with

virt-install -n kali -r 2048 --disk path=/dev/Raid10/vm.kali -c /torrents/kali-linux-2016.1-amd64.iso -w bridge:br0 --vnc --vnclisten=0.0.0.0 --os-type=linux --os-variant=debianwheezy

In this case the resulting XML file built was

<disk type='block' device='disk'>
  <driver name='qemu' type='raw' cache='none' io='native'/>
  <source dev='/dev/Raid10/vm.kali'/>
  <target dev='vda' bus='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>

We can see this uses the virtio driver.

The /dev/Raid10/vm.kali would be the equivalent of your /dev/sdc

Category: partition Time: 2016-07-29 Views: 3

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.113 (s). 12 q(s)