KVM或Xen遇到Unable to retrieve http images/install.img

简介:

用virt-install安装kvm或xen,如果是用URL安装,会遇到这个问题:

Unable to retrieve http://192.168.22.242/images/install.img

或者 Unable to retrieve http://mirrors.sohu.com/centos/6.5/os/x86_64/images/install.img 


解决方法

1,首先启动httpd服务,打开iptables的80端口,保证页面能访问

2,检查ip转发是否开启

1
2
3
4
5
6
7
cat  /etc/sysctl .conf | grep  ip_forward
net.ipv4.ip_forward = 1
如果没有开启,则
vim  /etc/sysctl .conf
net.ipv4.ip_forward = 1
   
/sbin/sysctl   -p



3,查看网络 

是否没有配置br0,只是yum安装的

1
2
3
# brctl show
bridge namebridge idSTP enabledinterfaces
virbr08000.feffffffffffyesvif4.0


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
cp   /etc/sysconfig/network-scripts/ifcfg-eth0   /etc/sysconfig/network-scripts/ifcfg-br0
   
cat  /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=****
ONBOOT= yes
NM_CONTROLLED=no
BOOTPROTO=static
BRIDGE=br0
DEFROUTE= yes
IPV4_FAILURE_FATAL= yes
IPV6INIT=no
NAME= "System eth0"
HWADDR=****
  
cat  /etc/sysconfig/network-scripts/ifcfg-br0 
DEVICE=br0
TYPE=Bridge
ONBOOT= yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=****
PREFIX=**
GATEWAY=****
DNS1=114.114.114.114
DOMAIN=114.114.114.114
DEFROUTE= yes
NAME= "System br0"
  
service network restart


1
2
3
4
# brctl show
bridge name    bridge  id            STP enabled    interfaces
br             08000.0800278072e5  no             eth0
virbr          08000.feffffffffff   yes             vif4.0


4,virt-install 后面接虚拟网卡的参数 -w bridge:br0


5,检查http挂载的iso目录.treeinfo

[images-x86_64]


initrd = images/pxeboot/initrd.img

kernel = isolinux/vmlinuz

[images-xen]

kernel = isolinux/vmlinuz

initrd = isolinux/initrd.img










本文转自 chengxuyonghu 51CTO博客,原文链接:http://blog.51cto.com/6226001001/1577561,如需转载请自行联系原作者
目录
相关文章
|
2月前
|
Ubuntu Linux Shell
(已解决)Linux环境—bash: wget: command not found; Docker pull报错Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled
(已成功解决)Linux环境报错—bash: wget: command not found;常见Linux发行版本,Linux中yum、rpm、apt-get、wget的区别;Docker pull报错Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled
669 68
(已解决)Linux环境—bash: wget: command not found; Docker pull报错Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled
|
8月前
|
Docker 容器
Failure Unable to retrieve image details-解决Portainer与Docker v26不兼容问题
Failure Unable to retrieve image details-解决Portainer与Docker v26不兼容问题
389 7
|
8月前
Centos8 Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist:
Centos8 Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist:
259 1
|
9月前
|
Ubuntu Linux 内存技术
Linux(14)Debain Make image and module configuration instructions
Linux(14)Debain Make image and module configuration instructions
45 0
|
KVM 虚拟化
Yum配置kvm时出现---Connot retrieve repository matedata balbalabal....
Yum配置kvm时出现---Connot retrieve repository matedata balbalabal....
Yum配置kvm时出现---Connot retrieve repository matedata balbalabal....
错误:为 repo ‘appstream‘ 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist
repos.d中更新一下源,使用vault.centos.org代替mirror.centos.org。执行以下两行代码进行修改。
1053 2
|
Linux 开发工具 Docker
Docker报错: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist
Docker报错: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist
372 0
|
Linux
LINUX虚拟机安装增强功能时报错: Kernel headers not found for target kernel. Please install them and execute
LINUX虚拟机安装增强功能时报错: Kernel headers not found for target kernel. Please install them and execute
314 0
|
Ubuntu 网络协议 Linux
Linux - Ubuntu下执行apt-get update报错:Some index files failed to download. They have been ignored, or old ones used instead.
Linux - Ubuntu下执行apt-get update报错:Some index files failed to download. They have been ignored, or old ones used instead.
2488 0
Linux - Ubuntu下执行apt-get update报错:Some index files failed to download. They have been ignored, or old ones used instead.
|
Linux Go
centos8 appstream大坑Failed to download metadata for repo appstream: Cannot prepare internal mirrorlis
centos8 appstream大坑Failed to download metadata for repo appstream: Cannot prepare internal mirrorlis
359 0