LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 07: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:	55
Size:	62.8 KB
ID:	14191 and Click image for larger version

Name:	ftp.png
Views:	42
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:	59
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, 07:22 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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 07:40 AM.
 
Old 12-12-2013, 07:23 AM   #3
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 728

Rep: Reputation: 143Reputation: 143
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, 07:39 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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, 09:44 AM   #5
mddnix
Member
 
Registered: Mar 2013
Distribution: Redhat, Ubuntu
Posts: 516

Rep: Reputation: 139Reputation: 139
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 mddnix; 12-12-2013 at 09:45 AM.
 
Old 12-14-2013, 03: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, 03: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:	43
Size:	106.5 KB
ID:	14207   Click image for larger version

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

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

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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 05:12 AM. Reason: Fixed weird sentence....
 
1 members found this post helpful.
Old 12-15-2013, 05:44 AM   #9
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 728

Rep: Reputation: 143Reputation: 143
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, 12:41 PM   #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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11: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 06:37 AM
how to install virtual machine remotely in centOS? cucolin@ Linux - Distributions 6 11-26-2008 11:52 PM
Unable to install Virtual Machine In Rhel5 with Virt-manager with CD-Rom Source prasun_mitra Linux - Enterprise 0 08-30-2007 04:03 AM


All times are GMT -5. The time now is 07:14 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration