云计算、AI、云原生、大数据等一站式技术学习平台

网站首页 > 教程文章 正文

KVM虚拟机安装OpenWRT

jxf315 2025-05-27 15:23:43 教程文章 9 ℃

一、下载openwrt镜像

我下载的是:
openwrt-23.05.5-x86-generic-generic-ext4-combined.img


二、使用virt-install直接安装

virt-install --name openwrt \

--osinfo=rhel7.0 --ram 512 --vcpus 2 \

--disk path=/home/openwrt-23.05.5-x86-generic-generic-ext4-combined.img,bus=virtio,cache=writeback \

--network bridge=br0,model=virtio \

--graphics=vnc,password=123456,port=5966,listen=0.0.0.0 \

--noautoconsole --import --autostart


三、几点解释

--osinfo=rhel7.0 必须指定该参数,操作系统版本

--network bridge=br0,model=virtio 半虚拟化的模式,会导致在 openWRT 中网卡显示为半双工,实际不影响。另:bridge=br0是启用的桥接模式。

--import 标记该虚拟机为导入,而不是创建

--autostart 开机自动启动


四、最后

启动后调整IP地址以及安装语言包

/etc/config/network #修改路由管理ip配置

opkg update && opkg install luci-i18n-base-zh-cn #安装中文语言包

最近发表
标签列表