Bookmark

Run an OpenWrt x86 VM on Proxmox VE: i12bretro Tutorial Adaptation

i12bretro tutorial 0405 builds an OpenWrt x86 VM on Proxmox VE. I keep the example values—VM ID 123, storage HDD_500GB, and LAN IP 10.10.27.151—so the original sequence remains reproducible; replace them with values from the local infrastructure.[9]

Youtube video player

The original video demonstrates the same process on YouTube.[14]

Prerequisites

I need the Proxmox web UI at https://ProxMoxDNSorIP:8006/, permission to open the node Shell, storage for the imported disk, and a LAN addressing plan. The OpenWrt root password is entered interactively at the console rather than stored in a file.[9]

1. Create the OpenWrt VM

Follow these Proxmox steps in order:[9]

  1. Open a browser and navigate to https://ProxMoxDNSorIP:8006/.[9]
  2. Click Create VM in the upper-right corner.[9]
  3. On General, name the VM OpenWRT, use VM ID 123 for the example, and click Next.[9]
  4. On OS, select Do not use any media, set Guest OS Type to Linux, Version to 5.x - 2.6 Kernel, and click Next.[9]
  5. On System, keep the defaults and click Next.[9]
  6. On Hard Disk, set Disk size to 0.001 and click Next.[9]
  7. On CPU, set the required number of cores and Type to host, then click Next.[9]
  8. On Memory, set 256 MiB and click Next.[9]
  9. On Network, choose Model VirtIO (paravirtualized), clear Firewall, and click Next.[9]
  10. On Confirm, review the settings and click Finish.[9]
  11. Select the new OpenWRT VM in the left panel.[9]
  12. Select Hardware in the sub-navigation.[9]
  13. Click the Hard Disk.[9]
  14. Click Detach at the top of the window to detach it from the VM.[9]
  15. Select the Unused disk.[9]
  16. Click Remove to permanently delete the small temporary disk.[9]
  17. Click Add → Network Device.[9]
  18. Set Model to VirtIO (paravirtualized), clear Firewall, and click Add.[9]

2. Download and import the OpenWrt disk

Select the Proxmox node and use Shell in these three actions:[9]

  1. Select the Proxmox node name in the left navigation.[9]
  2. Click Shell in the sub-navigation.[9]
  3. Run the following sequence. The first command reads the current stable version from the OpenWrt page; the rest downloads the x86/64 ext4 combined image, extracts it, renames it, expands the raw disk to 512 MB, and imports it into VM 123 on storage HDD_500GB.[9]
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# lookup the latest stable version number
regex='<strong>Current Stable Release - OpenWrt ([^/]*)<\/strong>' && response=$(curl -s https://openwrt.org) && [[ $response =~ $regex ]] && stableVersion="${BASH_REMATCH[1]}"
# download openwrt image
wget -O openwrt.img.gz https://downloads.openwrt.org/releases/$stableVersion/targets/x86/64/openwrt-$stableVersion-x86-64-generic-ext4-combined.img.gz
# extract the openwrt img
gunzip ./openwrt.img.gz
# rename the extracted img
mv ./openwrt*.img ./openwrt.raw
# increase the raw disk to 512 MB
qemu-img resize -f raw ./openwrt.raw 512M
# import the disk to the openwrt vm
# update the vm id and storage device as needed
# usage: qm importdisk <vmid> <source /> <storage>
qm importdisk 123 openwrt.raw HDD_500GB

The VM ID and storage must match the place where I will attach the disk. The tutorial uses the x86/64 ext4 combined image, so I do not silently substitute another target with a different layout.[9]

3. Attach the disk, boot, and set the password

After the import completes, continue in this order:[9]

  1. Select OpenWRT in the left panel and open Hardware.[9]
  2. Double-click Unused Disk and click Add.[9]
  3. Select Options in the sub-navigation.[9]
  4. Double-click Boot Order.[9]
  5. Check Enabled beside the hard disk.[9]
  6. Drag the hard disk to the appropriate boot position, usually below the CD-ROM.[9]
  7. Click OK.[9]
  8. Double-click Use tablet pointer, clear Enabled, and click OK.[9]
  9. Click Start in the upper-right corner.[9]
  10. Click Console to watch the boot process.[9]
  11. Wait for the text to stop scrolling and press Enter.[9]
  12. Run the root-password command:[9]
1
passwd
  1. Enter the new password twice directly in the console.[9]

4. Set the LAN address and install LuCI

In the OpenWrt console:

  1. Continue the configuration with the following commands.[9]
1
2
3
4
5
6
7
8
# set the lan ip address, use something in the same subnet as your LAN
uci set network.lan.ipaddr='10.10.27.151'
# restart network services
service network restart
# update openwrt packages
opkg update
# install the luci web ui
opkg install luci

After service network restart, the old console or access path can change. I use an address in the local LAN subnet instead of blindly reusing 10.10.27.151, then confirm that the router responds at the new address.[9]

5. Log in and verify

  1. Open a new browser tab and navigate to http://IPofVM, http://10.10.27.151 in the example.[9]
  2. At the login screen, enter username root and the password just set, then click Login.[9]
  3. Confirm that LuCI is available and the OpenWrt VM is running in Proxmox.[9]

Do not skip removal of the 0.001 temporary disk: the real disk should be the imported image enabled in Boot Order. If the VM will not boot, inspect Unused Disk, boot order, VirtIO device, console, and storage before rebuilding it.[9]

Original tutorial video: [watch it on YouTube]1.[14]

Source

Original source: [Run an OpenWRT VM on Proxmox VE]2, published/updated 2022-03-27.[9]

Sources

[9] https://i12bretro.github.io/tutorials/0405.html — Run an OpenWRT VM on Proxmox VE [14] https://www.youtube.com/watch?v=_fh7tnQW034 — Run an OpenWRT VM on Proxmox VE — i12bretro video


  1. https://www.youtube.com/watch?v=_fh7tnQW034 — official i12bretro video. ↩︎

  2. https://i12bretro.github.io/tutorials/0405.html — Run an OpenWRT VM on Proxmox VE. ↩︎


0 Bình luận

Góp Ý / Bình Luận / Đánh giá