LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Kickstarting VM fails (https://www.linuxquestions.org/questions/linux-server-73/kickstarting-vm-fails-928577/)

theillien 02-09-2012 09:13 PM

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.

mike_rhce 02-09-2012 09:35 PM

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.

theillien 02-09-2012 09:42 PM

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?

mike_rhce 02-09-2012 09:45 PM

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?

theillien 02-09-2012 09:46 PM

Yes it is running and I can connect from the three IPs listed.

mike_rhce 02-09-2012 09:58 PM

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.

theillien 02-10-2012 08:29 AM

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?

mike_rhce 02-10-2012 09:27 AM

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.)

theillien 02-10-2012 10:54 AM

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.

mike_rhce 02-10-2012 10:59 AM

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.

saifelyzal 02-10-2012 11:12 AM

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"

mike_rhce 02-10-2012 11:20 AM

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.

saifelyzal 02-10-2012 11:23 AM

then you need to create bridge network to access that network from the vm.

mike_rhce 02-10-2012 11:28 AM

I do include instructions on how to create that second "outsider" network, in Chapter 2, Exercise 2-1.

theillien 02-10-2012 01:07 PM

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


All times are GMT -5. The time now is 05:58 PM.