
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
KVM VirtualMachine of Xpenology DSM running in a docker container, which can be run directly from docker-hub by specifying a BOOTLOADER_URL or a local file.
This is just a kvm in docker which has been configured (and tested) to run xpenology dsm 6.2.3/7.2 with jun and redpill bootloader. So technically it can run any bootloader you provide.
Latest tested (for DS3615xs):
UPDATE:
-v /path/myfile:/bootloaderThis project contains only open-source code and does not distribute any copyrighted material.
This is for testing or educational purpose ONLY, and It is NOT recommended for using in production environment because it has no support, and it has not been proven stable/reliable.
Be aware that, Synology's Virtual DSM end-user license agreement does not permit installation on non-Synology hardware. So comply with this by using Synology hardware.
DATA LOSS can happen by using this system due to its instability, SO this is ONLY on your own responsibility to use.
If you are happy with the testing of this product, I would highly recommend you to go for an original Synology hardware, especially for PRODUCTION environment where data is critical.
Source code : https://github.com/uxora-com/xpenology-docker
Docker image: https://hub.docker.com/r/uxora/xpenology
Tutorial: [***]
Compile Redpill bootloader: https://github.com/uxora-com/rpext
NEW: rr bootloader: https://github.com/RROrg/rr
Personal testing has been done with ds3615xs jun's loader 1.03b and RedPill (with virtio/9p drivers).
Proxmox Lxc (OK):
MxLinux live usb (OK):
Windows 10 docker (OK but Slow):
Proxmox VM Linux Debian 10 (OK):
If you have any issue, please raise it in "issues" area.
This image provides some special features to get the VM running as straightforward as possible
modprobe kvm-intelmodprobe vhost-netbash# Simple run $ docker run --cap-add=NET_ADMIN --sysctl net.ipv4.ip_forward=1 \ --device=/dev/net/tun --device=/dev/kvm \ -p 5000-5001:5000-5001 \ -e BOOTLOADER_URL="http://example.com/path/synoboot.tgz" \ uxora/xpenology # Run with more specific parameters $ docker run --name="xpenodock" --hostname="xpenodock" \ --cap-add=NET_ADMIN --sysctl net.ipv4.ip_forward=1 \ --device=/dev/net/tun --device=/dev/kvm --device=/dev/vhost-net \ -p 5000-5001:5000-5001 -p 2222:22 -p 8080:80 \ -p 137-139:137-139 -p 443-445:443-445 -p 6690:6690 \ -p 7304:7304 -p 7681:7681 \ -e CPU="qemu64" -e THREADS=1 -e RAM=2048 \ -e DISK_SIZE="16G 16G" -e DISK_PATH="/xpy/diskvm" \ -e VM_ENABLE_9P="Y" -e VM_9P_PATH="/xpy/share9p" \ -e BOOTLOADER_AS_USB="Y" -e VM_ENABLE_VIRTIO="Y" \ -e BOOTLOADER_URL="http://example.com/path/synoboot.zip" \ -e GRUBCFG_SATAPORTMAP="6" -e GRUBCFG_DISKIDXMAP="00" \ -v /host_dir/data:/xpy/share9p -v /host_dir/kvm:/xpy/diskvm \ uxora/xpenology
Note0: For full disk passthrough, check tutorial here: [***]
Note1: If you do not want to use BOOTLOADER_URL, copy it as "bootloader.img" to DISK_PATH. In our 2nd example, bootloader should be copied to "/host_dir/kvm/bootloader.img".
Note2: After successfully running this container, you will be able to access the DSM WebUI with docker HOST_IP and port 5000 (i.e. 192.168.1.25:5000).
Note3: Log file is stored in DISK_PATH/log
Multiples environment variables can be modified to alter default runtime.
CPU: (Default "qemu64") type of cpu
THREADS: (Default "1") number of cpu threads per core
CORES: (Default "1") number of cpu cores
RAM: (Default "2048") number of ram memory in MB
DISK_SIZE:(Default "16") Size of virtual disk in GB
DISK_FORMAT: (Default "qcow2") Type of disk format (qcow2 support snapshot), check here for more details.
DISK_OPTS_DRV: (Default "cache=writeback,discard=on,aio=threads,detect-zeroes=on")
DISK_OPTS_DEV: (Default "rotation_rate=1")
DISK_PATH: (Default "/xpy/diskvm") Directory path where disk image (and bootloader) will be stored
BOOTLOADER_URL: (Default "") URL web link of the bootloader (i.e. "[***]")
-v /path/myfile:/bootloader , then it skips BOOTLOADER_URL download.BOOTLOADER_AS_USB: (Default "Y") Boot the bootloader as USB or as Disk
BOOTLOADER_FORCE_REPLACE: Remove existing bootloader in DISK_PATH before getting bootloader.
VM_NET_IP: (Default "20.20.20.21") Assigned IP for VM DHCP. Don't need to be changed.
VM_NET_MAC: (Default "00:11:32:2C:A7:85") Mac address use for VM DHCP to assigne VM_NET_IP. This need to match MAC set in xpenology grub bootloader.
VM_ENABLE_VGA: (Default "Yes") Enabling qxl vga and vnc. Not needed for Xpenology.
VM_ENABLE_VIRTIO: (Default "Yes") Enabling virtio disk. Make sure that bootloader has virtio drivers.
VM_ENABLE_VIRTIO_SCSI: (Default "No") Enabling virtio scsi disk. Make sure that bootloader has virtio drivers.
VM_ENABLE_9P: (Default "No") Enabling virtio 9p mount point. Need VM_ENABLE_VIRTIO enabled.
VM_9P_PATH: (Default "") Directories path of 9p mount point to be shared with xpenology
VM_9P_OPTS: (Default "local,security_model=passthrough") 9p fsdev options. Check here for more details.
VM_CUSTOM_OPTS: (Default "") Additional custom option to add to qemu command line
VM_CUSTOM_CODE: (Default "") Additional custom code to add before qemu command line
VM_TIMEOUT_POWERDOWN: (Default "30") Timeout for vm-power-down command
GRUBCFG_ENABLE_MOD: (Default "N") Auto set GRUBCFG_VID/GRUBCFG_PID if empty, depending on BOOTLOADER_AS_USB value. (Not needed for RR bootloader)
GRUBCFG_VID: (Default "") VendorID of bootloader disk.
GRUBCFG_PID: (Default "") ProductID of bootloader disk.
GRUBCFG_SN: (Default "") Serial number of DSM.
GRUBCFG_SATAPORTMAP: (Default "") Each digit is the number of port of a sata device (ie "6")
GRUBCFG_DISKIDXMAP: (Default "") 2 digits to map each sata device (ie "00")
GRUBCFG_HDDHOTPLUG: (Default "") Not used yet ...
The container has extra defined functions which allow you to manipulate the running VM:
Example:
bash$ docker exec $( docker container ls -f 'ancestor=uxora/xpenology' -f "status=running" -q ) vm-snap-create bckBeforeUpd $ docker exec xpenodock vm-snap-restore bckBeforeUpd
If you want to make some code changes of your own.
bash$ git clone https://github.com/uxora-com/xpenology-docker.git $ cd xpenology-docker $ # Make all your personal changed $ docker build -t uxora/xpenology .
You need xpenology bootloader image with virtio drivers for better compatibility.
Check this forum for more details about xpenology bootloader.
And follow this tutorial if you want to compile drivers for your specific xpenology version.
bash# Run xpenology docker (Warning: fake SN which need to be changed) $ docker run --name="xpenodock" --hostname="xpenodock" \ --cap-add=NET_ADMIN --sysctl net.ipv4.ip_forward=1 \ --device=/dev/net/tun --device=/dev/kvm \ -p 5000-5001:5000-5001 -p 2222:22 -p 8080:80 \ -p 137-139:137-139 -p 443-445:443-445 -p 6690:6690 \ -p 7304:7304 -p 7681:7681 \ -e RAM="1024" -e DISK_SIZE="16G" \ -e GRUBCFG_SN="1234ABC012345" \ -e GRUBCFG_SATAPORTMAP="6" -e GRUBCFG_DISKIDXMAP="00" \ -e DISK_PATH="/xpy/diskvm" -e VM_9P_PATH="/xpy/share9p" \ -v /host_dir/kvm:/xpy/diskvm -v /host_dir/data:/xpy/share9p \ -v /local_path/synoboot.tgz:/bootloader \ uxora/xpenology
bash# On docker host # Create a macvlan matching your local network $ docker network create -d macvlan \ --subnet=192.168.0.0/24 \ --gateway=192.168.0.1 \ --ip-range=192.168.0.100/28 \ -o parent=eth0 \ macvlan0 # Run xpenology docker (Warning: fake SN/URL which need to be changed) $ docker run --name="xpenodock" --hostname="xpenodock" \ --cap-add=NET_ADMIN --sysctl net.ipv4.ip_forward=1 \ --device=/dev/net/tun --device=/dev/kvm \ --network macvlan0 --ip=192.168.0.100 \ -e BOOTLOADER_URL="http://myurl/synoboot.tgz" \ -e RAM="2048" -e DISK_SIZE="32G" \ -e DISK_PATH="/xpy/diskvm" -e VM_9P_PATH="/xpy/share9p" \ -v /host_dir/kvm:/xpy/diskvm -v /host_dir/data:/xpy/share9p \ uxora/xpenology
bash# On docker host # Create a macvlan matching your local network $ docker network create -d macvlan \ --subnet=192.168.0.0/24 \ --gateway=192.168.0.1 \ --ip-range=192.168.0.100/28 \ -o parent=eth0 \ macvlan0 # Run xpenology docker (Warning: --device-cgroup-rule number may be different for you) $ docker run --name="xpenodock" --hostname="xpenodock" \ --cap-add=NET_ADMIN --device-cgroup-rule='c 235:* rwm' \ --device=/dev/net/tun --device=/dev/kvm --device=/dev/vhost-net \ --network macvlan0 -e VM_NET_DHCP="Y" \ -e BOOTLOADER_URL="https://github.com/RROrg/rr/releases/download/24.10.0/rr-24.10.0.img.zip" \ -e RAM="2048" -e DISK_SIZE="32G" \ -e DISK_PATH="/xpy/diskvm" -e VM_9P_PATH="/xpy/share9p" \ -v /host_dir/kvm:/xpy/diskvm -v /host_dir/data:/xpy/share9p \ uxora/xpenology
bash# Access container by name $ docker exec -ti xpenodock /bin/bash # Access container in another way $ docker exec -ti $( docker container ls -f 'ancestor=uxora/xpenology' -f "status=running" -q ) /bin/bash # Stop and Delete containers $ docker container stop xpenodock && docker container rm xpenodock # Delete docker image $ docker rmi $( docker image ls --filter 'reference=uxora/*' -q )
Open a ssh terminal on your xpenology dsm:
bash# Load 9p drivers, if not already loaded $ sudo insmod /volume1/homes/admin/9pnet.ko $ sudo insmod /volume1/homes/admin/9pnet_virtio.ko $ sudo insmod /volume1/homes/admin/9p.ko # In DSM web gui, create a "new share folder" in File Station (i.e. datashare9p) # then mount 9p hostdata0 to this folder $ sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=262144 hostdata0 /volume1/datashare9p $ sudo chown -R :users /volume1/datashare9p $ sudo chmod -R g+rw /volume1/datashare9p
Check [***] for 9p mount options (and set VM_9P_OPTS that suit you the best).
If you want automount 9p folder at boot time, use "Control Panel > Task Scheduler > Create > Triggered Task" to set this command line as root schedule task.
Make sure to forward SMB ports on docker command line by adding -p 137-139:137-139 -p 445:445.
Then access it by \\HOST_IP.
If you want to access by name, you will have to add it on hosts file of your machine.
CAUTION: Most important files are vm disks. As long as you keep it safe, you should be able to get back your xpenology.
-v option to mount host directory to DISK_PATH as -e DISK_PATH="/xpy/diskvm" -v /host_dir/kvm:/xpy/diskvm
DISK_PATH
/var/lib/docker/volumes/[...]/_data/If you need to change a bootloader parameter (VM_NET_MAC and GRUBCFG_*):
/host_dir/kvm) folder, uncompress : $ tar -xzf bootloader.img.tar.gz$ rm bootloader.img.tar.gz bootloader.qcow2Otherwise, for all others parameters :
$ docker container rm $( docker container ls -qf 'ancestor=uxora/xpenology' )$ docker run [...]--privileged) is not needed, but you may try it to see if it does not work on your system.If you get the following error from KVM:
qemu-kvm: -netdev tap,id=net0,vhost=on,fd=3: vhost-net requested but could not be initialized qemu-kvm: -netdev tap,id=net0,vhost=on,fd=3: Device 'tap' could not be initialized
vhost-net kernel module in your dockerhost (as root) prior to launch this container:bash$ modprobe vhost-net
Sometimes on start the VM some random errors appear(I don't know why yet)
cpage out of range (5) processing error - resetting ehci HC
If this happens to you, reboot the container
If you have permission issue with /dev/kvm or /dev/net/tun, give other +rw permission in host
bash$ chmod o+rw /dev/kvm $ chmod o+rw /dev/net/tun
If you have fuse issue
bash$ modprobe fuse # or # $ apt-get reinstall fuse
if iptables issue with msg like:
iptables v1.6.0: can't initialize iptables table `nat': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.
bash$ modprobe ip_tables
If you have corrupt file (13) during dsm installation
- Make sure you have set the right GRUBCFG_VID, GRUBCFG_PID and GRUBCFG_SN.
Something went wrong (hard drives and SATA ports)
With the following message
We've detected errors on the hard drive (x, y) and the SATA ports have also been disabled.
-e GRUBCFG_SATAPORTMAP="6" -e GRUBCFG_DISKIDXMAP="00"Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
[***]
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Michel VONGVILAY ([***]
Project based on :
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务