LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 04-13-2016, 01:38 PM   #1
gctaylor1
Member
 
Registered: Dec 2006
Distribution: Red Hat
Posts: 45

Rep: Reputation: 0
virt-install syntax for non-installation CDROM


I'm trying to have it so that a non-installation DVD/CD-ROM is mounted in my KVM guest after the installation is complete. I'm not using the CD/DVD for installation, I'm using kickstart via http. I've tried a few variations(commas, no commas, quotes) on the virt-install syntax below but I generally get the same type of usage message. I haven't found any examples for this on my www searches.
Code:
[root@supportvm ~]# virt-install --name=test1 --network network=example.org --ram=1024 --vcpus=2 --disk type='file',device='cdrom',driver name='qmeu',type='raw',source file='/home/user/isos/generic-dvd.iso',target dev='hda',bus='ide',readonly --disk path=/var/lib/libvirt/images/test1.img,size=9 --graphics=none --location=http://10.1.101.153/rhel70iso --os-type=linux --os-variant=rhel7 --extra-args='console=tty0 console=ttyS0,115200n8 serial ks=http://10.1.101.153/kickstart/test1-ks.cfg geoloc=0'   

usage: virt-install --name NAME --ram RAM STORAGE INSTALL [options]
virt-install: error: unrecognized arguments: device=cdrom,driver name=qmeu type=raw,source file=/home/user/isos/generic-dvd.iso target dev=hda bus=ide readonly
When I manually add the CD-ROM storage device here is what my guest xml file looks like afterwords:

<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/home/user/isos/generic-dvd.iso'/>
<target dev='hda' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>


My test1-ks.cfg works in that I get an entry added to my /etc/fstab
%post
echo "/dev/sr0 /media iso9660 defaults,ro 0 0" >> /etc/fstab
%end

# virt-install --version
1.2.1

Is there a way to incorporate the XML elements into my virt-install command?

Last edited by gctaylor1; 04-13-2016 at 05:22 PM.
 
Old 04-13-2016, 05:27 PM   #2
gctaylor1
Member
 
Registered: Dec 2006
Distribution: Red Hat
Posts: 45

Original Poster
Rep: Reputation: 0
I ended up putting virt-install in a shell script and adding virsh attach-disk at the end. Seems like I was asking virt-install to do something it was not intended to do.

Code:
[root@supportvm ~]# cat my_virt.sh
#!/bin/bash

dom=test1

virt-install --name="$dom" --network network=example.org --ram=1024 --vcpus=2 --disk path=/var/lib/libvirt/images/"$dom".img,size=9 --graphics=none --location=http://10.1.101.153/rhel70iso --os-type=linux --os-variant=rhel7 --extra-args="console=tty0 console=ttyS0,115200n8 serial ks=http://10.1.101.153/kickstart/${dom}-ks.cfg geoloc=0"

virsh destroy $dom
virsh attach-disk $dom /home/user/isos/generic-dvd.iso sda --type cdrom --mode readonly --persistent

virsh start $dom
 
  


Reply

Tags
kvm, virt-install



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Unable to install Linux(Centos) on virtual machine using virt-install --prompt shazgaurav Linux - Newbie 9 12-15-2013 11:41 AM
Virt-install mickeyboa Fedora 1 06-29-2010 04:48 PM
LXer: Hacking libvirt/virsh/virt-manager/virt-install at Xen 4.0 Dom0 on top of Ubunt LXer Syndicated Linux News 0 05-06-2010 02:50 PM
LXer: Virt-install&Virt-manager at Xen 4.0-rc8 (2.6.32.10 pvops) Dom0 on top Ubuntu K LXer Syndicated Linux News 0 03-26-2010 09:41 PM
virt-manager doesn't enable DVD installation media!! geek.ksa Linux - Virtualization and Cloud 8 01-05-2010 10:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 11:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration