LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 02-09-2012, 09:13 PM   #1
theillien
Member
 
Registered: Jan 2004
Posts: 107

Rep: Reputation: 0
Unhappy Kickstarting VM fails


I'm reading Michael Jang's RHCSA/RHCE Study Guide and have encountered a problem I can't solve. One of the exercises runs through the process of using virt-install to create a VM and install RHEL 6 onto it. The command in the book, while slightly wrong, is mostly right:
Code:
[root@study qemu]# virt-install -n outsider1.example.org -r 768 --disk path=/var/lib/libvirt/images/outsider1.example.org.img,size=12 -l ftp://192.168.100.1/pub/inst -x "ks=ftp://192.168.100.1/pub/ks/outsider1.cfg"
It's slightly wrong in that, according Mr. Jang himself via the book's Amazon discussion forum at http://www.amazon.com/Collecting-que...sin=0071765654, the IPs were wrong. I've since corrected them accoring to his post in that thread. However, I'm still experiencing a problem. It says the kickstart file cannot be downloaded.

I've verified that the ftp server is accessible from the three networks on the system I'm using: virbr0: 192.168.122.1, virbr1: 192.168.100.1 and eth0: 192.168.1.4.

Has anyone else encountered this and found the solution? I've even tried the one method suggested by another user in that thread which is to add the "--network network=outsider" parameter to the virt-install command. This did not solve the problem.
 
Old 02-09-2012, 09:35 PM   #2
mike_rhce
Member
 
Registered: Jun 2011
Posts: 160

Rep: Reputation: Disabled
Hi theillen,

Two common problems that you should check:

1) Permissions -- since you're using an FTP server, the Kickstart file can't be read unless there are read permissions for all users
2) SELinux contexts -- make sure it matches the defaults for the /var/ftp/pub directory

(I assume you're the person who has also posted in the message list on the Amazon page for the book. FYI, I sometimes also check the cert subforum here, http://www.linuxquestions.org/questi...tification-46/ .)

For more info, see p. 97-100 in the book.

Last edited by mike_rhce; 02-09-2012 at 09:42 PM.
 
Old 02-09-2012, 09:42 PM   #3
theillien
Member
 
Registered: Jan 2004
Posts: 107

Original Poster
Rep: Reputation: 0
Yes, that was me.

Permissions and contexts are all aligned:
Code:
[msnyder@study Downloads]$ cd /var/ftp/pub/
[msnyder@study pub]$ ll
total 8
dr-xr-xr-x. 12 root root 4096 Nov 17 12:11 inst
drwxr-xr-x.  2 root root 4096 Feb  9 16:35 ks
[msnyder@study pub]$ ll -Z
dr-xr-xr-x. root root system_u:object_r:public_content_t:s0 inst
drwxr-xr-x. root root system_u:object_r:public_content_t:s0 ks
[msnyder@study pub]$ ll -Z ks/
-rw-r--r--. root root system_u:object_r:public_content_t:s0 outsider1.cfg
[msnyder@study pub]$
The error in the Virt Viewer when it starts up is saying that it "Couldn't connect to server". Is it possible the network isn't being configured?
 
Old 02-09-2012, 09:45 PM   #4
mike_rhce
Member
 
Registered: Jun 2011
Posts: 160

Rep: Reputation: Disabled
Is your FTP server running? (run /etc/init.d/vsftpd status) While it's not the best security practice, it's often advisable to run a command like

chkconfig vsftp on

to make sure it's running on reboot too.

Other thought --

In the Virtual Machine Manager, click Edit | Connection Details
click the Virtual Networks tab

Do you see the 192.168.100.0 network (which I labeled as "outsider" in the book) in the list?

Last edited by mike_rhce; 02-09-2012 at 09:47 PM.
 
Old 02-09-2012, 09:46 PM   #5
theillien
Member
 
Registered: Jan 2004
Posts: 107

Original Poster
Rep: Reputation: 0
Yes it is running and I can connect from the three IPs listed.
 
Old 02-09-2012, 09:58 PM   #6
mike_rhce
Member
 
Registered: Jun 2011
Posts: 160

Rep: Reputation: Disabled
Okay, let's try something else. I just ran the following command:


virt-install -x "ks=ftp://192.168.100.1/pub/ks/outsider1-ks.cfg" -l /var/ftp/pub/inst --prompt

I'm then prompted for options, as follows

Quote:
What is the name of your virtual machine?
outsider1.example.org
How much RAM should be allocated (in megabytes)?
768
What would you like to use as the disk (file path)?
/var/lib/libvirt/images/outsider1.example.org.img
This will overwrite the existing path '/var/lib/libvirt/images/outsider1.example.org.img'
Do you really want to use this disk (yes or no)
yes

Starting install...
Retrieving file .treeinfo... | 768 B 00:00 ...
Retrieving file vmlinuz... | 7.5 MB 00:00 ...
Retrieving file initrd.img... | 59 MB 00:00 ...
Creating domain... | 0 B 00:00
Domain installation still in progress. You can reconnect to
the console to complete the installation process.
At that point, a VNC window appears that continues with a GUI-based view of the installation.

edit -- that was sloppy -- just checked again, and you can sub ftp://192.168.100.1/pub/inst for /var/ftp/pub/inst

If you still get the error, let me know where.

Last edited by mike_rhce; 02-09-2012 at 10:02 PM.
 
Old 02-10-2012, 08:29 AM   #7
theillien
Member
 
Registered: Jan 2004
Posts: 107

Original Poster
Rep: Reputation: 0
I get the same result: When trying to download the kickstart file it fails to connect to the server. This makes me wonder about network configuration. I don't have a DHCP server dishing out configurations to these as far as I know unless they're being bridged to my main home network. That doesn't seem to be the case, though. How do I force a network configuration?
 
Old 02-10-2012, 09:27 AM   #8
mike_rhce
Member
 
Registered: Jun 2011
Posts: 160

Rep: Reputation: Disabled
OK, I've tried various options to try to replicate your issue. Here's what I find.

My virbr1 device is the outsider VM network, with IP address 192.168.100.1

Normally, it's running, as confirmed by this output excerpt to the ifconfig virbr1 command

virbr1 Link encap:Ethernet HWaddr 52:54:00:35:84:FF
inet addr:192.168.100.1 Bcast:192.168.100.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

When it's down, I see this instead in the third line:

BROADCAST MULTICAST MTU:1500 Metric:1

In that case, in the VNC window that appears, I get the following error message:

failed to retrieve ftp://192.168.100.1/pub/ks/outsider1-ks.cfg: Couldn't connect to server

If this is where you're seeing the connection problem, check for activity on your virtual network devices. If you do get the VNC window at all, click Send Key | Ctrl+Alt+F3 and Send Key | Ctrl+Alt+F4 for messages associated with the VM creation process.

Alternatively, if you get an error message at the command line, before any VNC window appears, it might look something like:

ERROR [Errno 111] Connection refused

or

ERROR [Errno 113] No route to host

(To indirectly answer your question about forcing network configuration -- make sure your libvirtd and libvirt-guests services are running. That also controls the virtual network devices.)

Last edited by mike_rhce; 02-10-2012 at 09:32 AM.
 
Old 02-10-2012, 10:54 AM   #9
theillien
Member
 
Registered: Jan 2004
Posts: 107

Original Poster
Rep: Reputation: 0
I do see the "failed to retrieve ftp://192.168.100.1/pub/ks/outsider1-ks.cfg: Couldn't connect to server" error. I'll have to double-check the configuration of the virbr1 interface. I've been fairly certain that it is active, but I could be wrong.
 
Old 02-10-2012, 10:59 AM   #10
mike_rhce
Member
 
Registered: Jun 2011
Posts: 160

Rep: Reputation: Disabled
When you do check the virbr1 device, also check the messages in the third and fourth virtual consoles (click Send Key | Ctrl+Alt+F3 and Send Key | Ctrl+Alt+F4 ). The messages in those consoles can also provide clues.
 
Old 02-10-2012, 11:12 AM   #11
saifelyzal
LQ Newbie
 
Registered: Jun 2011
Distribution: Redhat
Posts: 28

Rep: Reputation: Disabled
Hi, if you using default network then your ftp server it should point to 192.168.122.1
try this
[root@study qemu]# virt-install -n outsider1.example.org -r 768 --disk path=/var/lib/libvirt/images/outsider1.example.org.img,size=12 -l ftp://192.168.122.1/pub/inst -x "ks=ftp://192.168.122.1/pub/ks/outsider1.cfg"
 
Old 02-10-2012, 11:20 AM   #12
mike_rhce
Member
 
Registered: Jun 2011
Posts: 160

Rep: Reputation: Disabled
Dear Saifelyzal,

Thanks for your note. What you say is true. However, one of the points of the example.org network (192.168.100.0/24) is that it represents an outside network (not the default) -- subsequent firewall options in the book are designed to prevent access from that network.
 
Old 02-10-2012, 11:23 AM   #13
saifelyzal
LQ Newbie
 
Registered: Jun 2011
Distribution: Redhat
Posts: 28

Rep: Reputation: Disabled
then you need to create bridge network to access that network from the vm.
 
Old 02-10-2012, 11:28 AM   #14
mike_rhce
Member
 
Registered: Jun 2011
Posts: 160

Rep: Reputation: Disabled
I do include instructions on how to create that second "outsider" network, in Chapter 2, Exercise 2-1.
 
Old 02-10-2012, 01:07 PM   #15
theillien
Member
 
Registered: Jan 2004
Posts: 107

Original Poster
Rep: Reputation: 0
Images indicating the errors I'm getting:
https://picasaweb.google.com/lh/phot...eat=directlink

https://picasaweb.google.com/lh/phot...eat=directlink

https://picasaweb.google.com/lh/phot...eat=directlink

Last edited by theillien; 02-10-2012 at 01:13 PM.
 
  


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
Kickstarting Linux over HTTPS RHAPOLLO Red Hat 1 08-15-2010 04:42 AM
Kickstarting from an external USB cdrom johnnymta Linux - Server 3 09-10-2009 05:49 AM
Kickstarting - Some distros work, some don't! doof205 Linux - General 0 03-09-2006 09:27 AM
Kickstarting Dell 2850 jz52dk Linux - Software 1 02-19-2006 12:41 AM
Kickstarting ETH0 GEEXTER Linux - Networking 8 11-11-2002 06:51 PM


All times are GMT -5. The time now is 12:36 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration