Jump to content
XPEnology Community

uxora-com

Member
  • Posts

    42
  • Joined

  • Last visited

Posts posted by uxora-com

  1. On 4/6/2021 at 12:27 PM, RobbieT said:

     

    You should set the bootloader as a usb drive and update your pid and vid. After that you can succesfully update.

    To do this; detach the 50m drive within proxmox.

    Then ssh to your proxmox setup and place the synoboot.img file in the following folder:

    
    /var/lib/vz/images/107/synoboot.img

     

    Replace 107 with the id of your xpenology install.

     

    When that is done adjust your vm conf file within:

    
    /etc/pve/qemu-server/<VMID>.conf

    VMID is the ID of your vm.

     

    On the top of the file add: 

    
    args: -device 'nec-usb-xhci,id=usb-bus0,multifunction=on' -drive 'file=/var/lib/vz/images/107/synoboot.img,media=disk,format=raw,if=none,id=drive-disk-bootloader' -device 'usb-storage,bus=usb-bus0.0,port=1,drive=drive-disk-bootloader,id=usb-disk-bootloader,bootindex=999,removable=on'

    Replace 107 with the ID of your xpenology install in Proxmox.

     

    Reboot the xpenology VM and start a ssh session to your xpenology and follow the steps below:

     

    - Start a root session with: sudo -i and reenter the password

     

    Find vendor ID;

     

    
    # Find vendor id and product id of bootloader usb disk
     lsusb
    |__usb1          1d6b:0002:0310 09  2.00  480MBit/s 0mA 1IF  (ehci_hcd 0000:00:1a.7) hub
    [ ... ]
    |__usb9          1d6b:0002:0310 09  2.00  480MBit/s 0mA 1IF  (xhci_hcd 0000:00:01.0) hub
    |__usb10         1d6b:0003:0310 09  3.00 5000MBit/s 0mA 1IF  (xhci_hcd 0000:00:01.0) hub
    |__10-1        46f4:0001:0000 00  3.00 5000MBit/s 0mA 1IF  (QEMU QEMU USB HARDDRIVE 1-0000:00:01.0-1)
     
     
    # Vendor id (46f4) and product id (0001) is found
    # Set these in grub.cfg
    # In order to not be automaticaly mount in dsm 
     sed -i \
    -e "s/\(set vid=\)\(.*\)/\10x46f4/g" \
    -e "s/\(set pid=\)\(.*\)/\10x0001/g" \
    /volumeUSB1/usbshare1-1/grub/grub.cfg
     
     
    # (Optional) Set different serial number or mac
     mySN="1330LWN023501"
     myMAC1="DE0C1A817DE8"
     sed -i \
    -e "s/\(set sn=\)\(.*\)/\1${mySN}/g" \
    -e "s/\(set mac1=\)\(.*\)/\1${myMAC1}/g" \
    /volumeUSB1/usbshare1-1/grub/grub.cfg

     

    Reboot the xpenology and update!

     

    That's nice of you, @RobbieT, to help ppl by copying and paste a part of my tutorial.
    Of course, u can copy/paste as much as u want to help ppl ... But u know, what is even better and nicer ?
    It's to specify the source where it comes from https://www.uxora.com/other/virtualization/55-install-xpenology-dsm-6-2-x-on-proxmox#Changexpenologyparameteringrub.cfg . ;) 

  2. 14 hours ago, ferno said:

    One question, does the boot loader have to be loaded from a URL?

     

     

    From this docker, yes because this is how it has been designed.
    But it is just needed once at the first container's run.
    If you don't have a webserver, you can use gofile.io as explained in the tutorial.

     

    HTH

     

  3. 23 hours ago, ferno said:

    Oh, almost forgot, all links to the modified boot loader are unavailable, can you help me get one?

     

     

    You got all links in this tutorial  : https://www.uxora.com/other/virtualization/57-xpenology-on-docker

     

    I'm not sure what you really try to do so the only advise I think i can give you is the less layers you got the better it get:
    1- Baremetal -> DSM
    2- Baremetal -> OS -> Qemu-kvm -> DSM
    3- Baremetal -> OS -> Lxc/Docker -> Qemu-kvm -> DSM
    4- Baremetal -> OS -> Lxc -> Docker -> Qemu-kvm -> DSM

     

    Qemu-kvm is a VM and it is isolated enough so it doesn't really need to add another jail stuff I think.
    But it all depends on what you want to do and the capabilities of your first OS layer.

    HTH 

  4. 1 hour ago, LittleLama said:

    Does 9P gives the possibility to mount a host drive at the place of a Dsm shared folder ?

    If I want to mount the host directory as replacement of DSM volume1/music directory to let it serve Audio Station, would it be possible ?
    NFS share can't do this, does 9P ?

     

    I don't really use 9p in my main xpenology, but just play with it a bit on a test system.

    9p allow you to passthrough a folder from host to VM, and yes, I was able to make it as a DSM shared folder.
    For that, you just need to create the folder as root, then mount it as 9p, then create a shared folder on DSM with with same folder name.

     

    For ex:

    [root]$ mkdir /volume1/datashare
    [root]$ mount -t 9p -o trans=virtio,version=9p2000.L,msize=262144 hostdata /volume1/datashare/
    # And then create "datashare" DSM shared folder in volume1 

     

    Maybe this can be done with NFS as well, I have never tried it yet but I don't see why this cannot be done.

     

    For encrypted shared folder, I have never tried so I don't know ... let us know if to get this working.


    HTH 

     

  5. 44 minutes ago, LittleLama said:

    Yes, storing vdisk outside is the solution, but I didn't succeed in making it working due to(i guess) permission restrictions.
    Now that my docker has been fixed I should make a new try.

     

    On my test machine, I run docker container as root on a Debian 10.
    I just tried and it works for me ... I don't have any permission issue and 9p mount is working as well.


    If it cannot create vdisk on /datashare then the permission issue is between the Host/User->Docker->Container ... and not the virtual machine running inside the container.


    As I suggest to whuang, try to get terminal access to linux OS container with the following command (when container is running) :
     

    docker exec -ti $( docker container ls -f 'ancestor=uxora/xpenology' -f "status=running" -q ) /bin/bash

     

    Then try to test/debug/figure out why you have permission issue which can be due to :
    - Docker configuration issues
    - Host or User permissions issues


    And let us know if you find out the issue.

    HTH

  6. 17 minutes ago, LittleLama said:

    Docker is restarted:
    -either by unraid when a setting is changed by me in the docker container
    -either by unraid when restarting the whole server
    -most of the time by DSM itself


    I don't use UNRAID and don't really know how it manages docker.

    - "most of the time by DSM itself" : DSM can restart (which do not close the container) or it can shutdown (which normally terminate the container at the end)
    -  "either by unraid" : Not sure how it manages docker but if it runs the full docker parameters when it restart, then this will create a new container at every restart. A new container will create new virtual disks if not exists, and need to do dsm installation again. 

    Normally you should run the full run parameter only once to create the container, then you can stop/start/restart the container with the containerID (ie. docker container start <containerID>).
    Otherwise, if you really want/need to create new container at every reboot (and don't care about saving disk space 😛 ) then "maybe" you can try to change DISK_PATH to a external storage (outside the container)  like "/datashare" to store virtual disks.

    HTH

  7. On 2/19/2021 at 11:03 AM, LittleLama said:

    After that, I tried to add some other shared directories on my Docker and ... after reboot I had to reinstall DSM !

    I don't understand what happened.

     

    Maybe someone could give me a hint ?

     

    Hi,

    How do you restart your docker container?
     

  8. On 1/28/2021 at 6:01 AM, whuang said:

     

    Hi, HTH

     

    Thank you for the quick reply.

     

    After adding "-it --entrypoint /bin/bash" that you suggested, when running docker/xpenology, it does not show "iptables: No chain/target/match by that name." any more.

     

    I don't find the  "/usr/bin/vm-startup" script in my system.  I wonder if you could kindly show me an example how to incorporate what you suggested in that script.

     

    I really appreciate your advise/help.

     

    Regards,

    Wade


    Adding "-it --entrypoint /bin/bash" makes the containers run "/bin/bash" instead of default "/usr/bin/vm-startup" (define in Dockerfile).
    This gives you access to the command line in the uxora/xpenology container and it's in there you can find "/usr/bin/vm-startup"!

    Maybe once you get command line access to the containers, I dont know ... try to find out what the issue by running for exemple:
    - $ iptables -A POSTROUTING -t mangle -p udp --dport bootpc -j CHECKSUM --checksum-fill
    - $ /usr/bin/vm-startup

     

    If you don't really make an effort to really find out, I cannot be much help. Sorry.

    HTH == "Hope That helps"

    • Like 1
  9. 1 hour ago, whuang said:

    Hi, everyone

     

    Got following error when running docker/xpenology.  Any thoughts?  Any help will be much appreciated!

     

    docker run --privileged --cap-add=NET_ADMIN \
    >     --device=/dev/net/tun --device=/dev/kvm \
    >     -e CPU="qemu64" \
    >     -e THREADS=1 \
    >     -e RAM=512 \
    >     -e DISK_SIZE="8G 10G" \
    >     -e DISK_PATH="/image" \
    >     -e BOOTLOADER_URL="http://192.168.1.10/synoboot_104b_ds918plus_virtio_9p.img" \
    >     -e BOOTLOADER_AS_USB="Y" \
    >     -e VM_ENABLE_VIRTIO="Y" \
    >     uxora/xpenology
    INFO: Start downloading bootloader from URL ...

         0K ........ ........ ........ ........ 64%  117M 0s
     32768K ........ ........ ..               100% 82.7M=0.5s
    INFO: Bootloader has been successfully downloaded from URL.
    INFO: /image/bootloader.raw file size seems valid for synoboot.
    INFO: Bootloader has been converted to qcow2
    INFO: No Initial Disk found, creating disk /image/vm-disk-1.qcow2
    Formatting '/image/vm-disk-1.qcow2', fmt=qcow2 size=8589934592 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
    INFO: No Initial Disk found, creating disk /image/vm-disk-2.qcow2
    Formatting '/image/vm-disk-2.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
    INFO: KVM acceleration enabled
    INFO: Configuring network ...
    net.ipv4.ip_forward = 1
    INFO: DHCP configured to serve IP 20.20.20.21/24 via dockerbridge
    iptables: No chain/target/match by that name.
     


    As I did reply to you already in the article, for me, it works on several machine without getting this issue.

    This error may come from your Docker/Host machine configuration.

    However, the following command seems to be the one throwing that error:

    # Hack for guest VMs complaining about "bad udp checksums in 5 packets"
    $ iptables -A POSTROUTING -t mangle -p udp --dport bootpc -j CHECKSUM --checksum-fill


    You can try to test/debug by running a bash prompt with "-it --entrypoint /bin/bash"  as follow:

    docker run --privileged --cap-add=NET_ADMIN \
         --device=/dev/net/tun --device=/dev/kvm \
         -e CPU="qemu64" \
         -e THREADS=1 \
         -e RAM=512 \
         -e DISK_SIZE="8G 10G" \
         -e DISK_PATH="/image" \
         -e BOOTLOADER_URL="http://192.168.1.10/synoboot_104b_ds918plus_virtio_9p.img" \
         -e BOOTLOADER_AS_USB="Y" \
         -e VM_ENABLE_VIRTIO="Y" \
         -it --entrypoint /bin/bash \
         uxora/xpenology

     

    Try to test and see why the faulty "iptables" command does not work.

    Or edit "/usr/bin/vm-startup" script as you please (maybe like removing faulty cmd)
    Then run that script to launch xpenology kvm.

     

    Let me know if you find something... like this I may change the script to be more compatible.

    HTH

  10. 11 hours ago, ZuruiKitsune said:

    in uxora/xpenology image, when use  BOOTLOADER_AS_USB=Y in a part of .pat install to :5000

    get error xpenology failed to install the file. the file is probably corrupted. (13)

    if set BOOTLOADER_AS_USB=N = working

     

    segator/xpenology:latest from dockerhub DSM 6.0.2 work, but don't auto_attach qcow2 created disk, Someone now "howto" i can attach it?

    BOOTLOADER_AS_USB

     

    I don't know which bootloader and dsm version you are using ...
    But I just tried on a new docker with "synoboot_103b_ds3615xs_virtio_9p.img" bootloader and DSM_DS3615xs_25426.pat, and it still work for me by following this tutorial https://www.uxora.com/other/virtualization/57-xpenology-on-docker
     

  11. On 1/19/2021 at 10:45 AM, apriliars3 said:

     

    I have this issue and no work docker xpenology

     

    INFO: Start downloading bootloader from URL ...

    ERROR: Bootloader cannot be downloaded from URL.

    WARNING: /image/bootloader.raw file size does not seem correct for synoboot.

    INFO: Bootloader has been converted to qcow2

    INFO: No Initial Disk found, creating disk /image/vm-disk-1.qcow2

    Formatting '/image/vm-disk-1.qcow2', fmt=qcow2 size=34359738368 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16

    INFO: KVM acceleration enabled

    INFO: Configuring network ...

    add bridge failed: Operation not permitted

    WARNING: /image/bootloader.raw file size does not seem correct for synoboot.

    ERROR: No Initial Disk found, CANNOT create disk /image/vm-disk-1.qcow2

    INFO: KVM acceleration enabled

     

    Probably because your URL pointing to bootloader is not valid.
    And you do not have user permission to modify network configuration (try to run it as root)
    Check this article which may help you: https://www.uxora.com/other/virtualization/57-xpenology-on-docker

    HTH

  12. On 1/17/2021 at 9:29 PM, jesta said:

     

    Hey there! IG-88's driver extensions all have virtio and 9p drivers added (although not loaded by default, needs a modified /etc/rc.modules) but we can't make 9p work. I'm using UnRAID and the drivers seem to get loaded fine (no errors in dmesg, lsmod shows them loaded) but no devices appear in /sys/bus/virtio/drivers/... and trying to mount the UnRAID share using "mount -t 9p -o trans=virtio <mount_tag> </local/path>" results in an error in bash: "mount: special device unraid does not exist" and in dmesg:  "9pnet_virtio: no channels available".

     

    Any pointers how you got it working?


    Read "Variables" and "Mount Docker Host Volumes to Xpenology" part of the documentation here: https://hub.docker.com/r/uxora/xpenology
    In Docker, if you use default value of VM_PATH_9P (Default "/datashare") then you should use docker -v option like "-v /shared/data:/datashare".

    In xpenology terminal, use :"$ sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=262144 hostdata /volume1/datashare".
    HTH

  13. I found these bootloader, with virtio drivers loaded, that may work for you: 😀

     

    - ds3617xs : https://gofile.io/d/pnBQbd

    It does not work for me, it launch but stay block at "Loading module adt7475", don't know why.
    But it does work directly as proxmox vm without docker.

     

    -ds918+ : https://gofile.io/d/wfNCxt

    It works for me in mxlinux usb live but it does not works on my proxmox VM or Lxc container.

    For this bootloader, you need to specify the VM_MAC to docker as follow:

          -e VM_MAC="00:11:32:12:34:56"

     

    You can give it a try if you want, if so ... then let me know how it goes for you.

  14. 22 hours ago, ilovepancakes said:

     

    This is awesome! Thanks for your work on this. It worked for me. Is there a way to make it work with 1.04b loader for DS918+?

     

     

    Thank you for your feedback, can i ask you which hardware and os are you using ?
    I haven't tried ds3617xs and ds918+ yet ... I will work on it when got some spare time.

     

    19 hours ago, Cosaque said:

    well ty for this !

    this docker_compose work well !


    Ok good, can i ask you which hardware and os are you using as well?
    Thanks.

  15. For those, who still are interested in running a Xpenology on a Docker ... I have forked and updated this project to make it works with dsm 6.2.3.


    Here is the link:
    - to the source project: https://github.com/uxora-com/xpenology-docker
    - to the docker hub image : https://hub.docker.com/r/uxora/xpenology

    And last, here is the link to the bootloader with virtio loaded at boot : https://gofile.io/d/bym4Cc
    Note that "download" url in webpage on this link can be used as BOOTLOADER_URL once it has been generated by clicking on the link.

    Instruction:
    - Install Docker
    - Then run:

    $ docker run --privileged \
    	-p 5000:5000 -p 5001:5001 -p 2222:22 -p 8080:80 \
    	-e RAM=512 \
    	-e DISK_SIZE="32G" \
    	-e BOOTLOADER_URL="http://example.com/path/synoboot.img" \
    	-e BOOTLOADER_AS_USB="Y" \
    	-e VM_ENABLE_VIRTIO="Y" \
    	uxora/xpenology



    Let me know if it works (or not) for you.

×
×
  • Create New...