LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-12-2013, 06:11 AM   #1
shazgaurav
LQ Newbie
 
Registered: Apr 2013
Posts: 29

Rep: Reputation: Disabled
Unable to install Linux(Centos) on virtual machine using virt-install --prompt


Hello,

I was trying to install linux on virtual machine using iso image over ftp and http.Though both servers seem to work(ScreenshotsClick image for larger version

Name:	apache.png
Views:	124
Size:	62.8 KB
ID:	14191 and Click image for larger version

Name:	ftp.png
Views:	102
Size:	58.0 KB
ID:	14192) but I am persistently getting error where I suppose the kvm hypervisor is unable to locate that iso image over ftp or http(error in screenshotsClick image for larger version

Name:	error.png
Views:	121
Size:	82.8 KB
ID:	14193).I googled it for couple of days now but no luck.Since I am a newbie it would be a silly mistake on my side which I am unable to locate.Could someone please help me after seeing the screenshot.Please let me know in case you need any other info.Any help would be highly appericiated.

Thanks
 
Old 12-12-2013, 06:22 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Try adding a / at the end.
Code:
ftp://192.168.1.6/inst/
or
Code:
ftp://192.168.1.6/pub/

Wasn't thinking straight, see next answer.

Last edited by druuna; 12-12-2013 at 06:40 AM.
 
Old 12-12-2013, 06:23 AM   #3
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
If you are trying to do the install pulling files from ftp, you have to extract the files from the iso image first. The install does not know how to handle an iso file.

So mount the iso then copy the contents to the ftp server
 
1 members found this post helpful.
Old 12-12-2013, 06:39 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by ericson007 View Post
If you are trying to do the install pulling files from ftp, you have to extract the files from the iso image first. The install does not know how to handle an iso file.

So mount the iso then copy the contents to the ftp server
You might have a very good point there......
 
Old 12-12-2013, 08:44 AM   #5
Madhu Desai
Member
 
Registered: Mar 2013
Distribution: Rocky, Fedora, Ubuntu
Posts: 541

Rep: Reputation: 153Reputation: 153
As ericson007 has already mentioned, if you want to install from remote source, you have to point to a directory where iso file is already extracted. CDROM and ISO file are only applicable for local source.

Also, you may want to create a disk prior to installing OS, because by default the image (img) created by KVM will be equal to the size you mentioned. For example, if want disk size of 100 GB, then image file will be actually 100GB. So create disk file first:

Code:
# qemu-img create -f qcow2 /var/lib/libvirt/images/testbox.qcow2 100G
Then you can install any OS with virt-install --prompt, and point to already created disk when asked.

Or, you can do the following (single step):

Code:
# virt-install --connect qemu:///system \
--name testbox --ram 1024 --vcpus 1 \
--disk path=/var/lib/libvirt/images/testbox.qcow2,format=qcow2,size=100 \
--network network=default \
--cdrom /var/ftp/pub/iso/centos65.iso \
--os-type linux --os-variant rhel6 \
--virt-type kvm --graphics vnc --hvm
OR

Code:
# virt-install --connect qemu:///system \
--name testbox --ram 1024 --vcpus 1 \
--disk path=/var/lib/libvirt/images/testbox.qcow2,format=qcow2,size=100 \
--network network=default \
--location ftp://192.168.1.74/pub/centos65
--os-type linux --os-variant rhel6 \
--virt-type kvm --graphics vnc --hvm

Last edited by Madhu Desai; 12-12-2013 at 08:45 AM.
 
Old 12-14-2013, 02:08 AM   #6
shazgaurav
LQ Newbie
 
Registered: Apr 2013
Posts: 29

Original Poster
Rep: Reputation: Disabled
I tried extracting iso image and placing files in respective folders,still the problem persists.Is there anyother configuration changes that I am missing?
 
Old 12-14-2013, 02:11 AM   #7
shazgaurav
LQ Newbie
 
Registered: Apr 2013
Posts: 29

Original Poster
Rep: Reputation: Disabled
Here are the latest screenshots.
Attached Thumbnails
Click image for larger version

Name:	apache.png
Views:	85
Size:	106.5 KB
ID:	14207   Click image for larger version

Name:	error.png
Views:	64
Size:	93.0 KB
ID:	14208   Click image for larger version

Name:	ftp.png
Views:	62
Size:	102.8 KB
ID:	14209  
 
Old 12-14-2013, 03:21 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by shazgaurav View Post
I tried extracting iso image and placing files in respective folders,still the problem persists.Is there anyother configuration changes that I am missing?
Did you copy all the files from the ISO (including the dot files)? The dot files are important:
Code:
$ cd /path/to/mounted/iso/
cp -ar . /path/to/ftp_or_http/directory/
My RedHat installation files are available by both httpd and ftp and that does work:
Code:
# virt-install --prompt
What is the name of your virtual machine? test01
 How much RAM should be allocated (in megabytes)? 1024
 What would you like to use as the disk (file path)? /var/lib/libvirt/images/test01.img
 How large would you like the disk (/var/lib/libvirt/images/test01.img) to be (in gigabytes)? 10
 What is the install CD-ROM/ISO or URL? http://192.168.100.12:8064/

Starting install...
Retrieving file .treeinfo...                             | 3.2 kB     00:00 ... 
Retrieving file vmlinuz...                               | 7.7 MB     00:00 ... 
Retrieving file initrd.img...                            |  60 MB     00:00 ...
I can reach the files from the browser with the same URL (mine is listening on port 8064, that explains the :8064 part).

Using ftp:
Code:
 # virt-install --prompt
What is the name of your virtual machine? test02
 How much RAM should be allocated (in megabytes)? 1024
 What would you like to use as the disk (file path)? /var/lib/libvirt/images/test02.img
 How large would you like the disk (/var/lib/libvirt/images/test02.img) to be (in gigabytes)? 10
 What is the install CD-ROM/ISO or URL? ftp://192.168.100.12/pub/

Starting install...
Retrieving file .treeinfo...                             | 3.2 kB     00:00 ... 
Retrieving file vmlinuz...                               | 7.7 MB     00:00 ... 
Retrieving file initrd.img...                            |  60 MB     00:00 ...

Last edited by druuna; 12-14-2013 at 04:12 AM. Reason: Fixed weird sentence....
 
1 members found this post helpful.
Old 12-15-2013, 04:44 AM   #9
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
If you copied the files over using root account the lables may be wrong.

Run
Code:
restorecon -Rv /ftp/folder
Also open port 21 on your firewall.
 
Old 12-15-2013, 11:41 AM   #10
shazgaurav
LQ Newbie
 
Registered: Apr 2013
Posts: 29

Original Poster
Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by druuna View Post
Did you copy all the files from the ISO (including the dot files)? The dot files are important:
Code:
$ cd /path/to/mounted/iso/
cp -ar . /path/to/ftp_or_http/directory/
My RedHat installation files are available by both httpd and ftp and that does work:
Code:
# virt-install --prompt
What is the name of your virtual machine? test01
 How much RAM should be allocated (in megabytes)? 1024
 What would you like to use as the disk (file path)? /var/lib/libvirt/images/test01.img
 How large would you like the disk (/var/lib/libvirt/images/test01.img) to be (in gigabytes)? 10
 What is the install CD-ROM/ISO or URL? http://192.168.100.12:8064/

Starting install...
Retrieving file .treeinfo...                             | 3.2 kB     00:00 ... 
Retrieving file vmlinuz...                               | 7.7 MB     00:00 ... 
Retrieving file initrd.img...                            |  60 MB     00:00 ...
I can reach the files from the browser with the same URL (mine is listening on port 8064, that explains the :8064 part).

Using ftp:
Code:
 # virt-install --prompt
What is the name of your virtual machine? test02
 How much RAM should be allocated (in megabytes)? 1024
 What would you like to use as the disk (file path)? /var/lib/libvirt/images/test02.img
 How large would you like the disk (/var/lib/libvirt/images/test02.img) to be (in gigabytes)? 10
 What is the install CD-ROM/ISO or URL? ftp://192.168.100.12/pub/

Starting install...
Retrieving file .treeinfo...                             | 3.2 kB     00:00 ... 
Retrieving file vmlinuz...                               | 7.7 MB     00:00 ... 
Retrieving file initrd.img...                            |  60 MB     00:00 ...
Thank you so much.It works great.I was simply copying the files earlier.This is solved.Many thanks for reply
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Install Endian as a Virtual Machine on CentOS ? cletus8 Linux - Virtualization and Cloud 4 05-13-2012 10:37 PM
Cant install Virtual machine in CentOS 6 Cannot find package qemu-kvm in yum install linux_rhca Linux - Newbie 4 10-19-2011 05:37 AM
how to install virtual machine remotely in centOS? cucolin@ Linux - Distributions 6 11-26-2008 10:52 PM
Unable to install Virtual Machine In Rhel5 with Virt-manager with CD-Rom Source prasun_mitra Linux - Enterprise 0 08-30-2007 03:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:47 PM.

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