{"id":13509899,"url":"https://github.com/lnxbil/docker-machine-driver-proxmox-ve","last_synced_at":"2025-07-25T03:18:47.171Z","repository":{"id":50254050,"uuid":"123041158","full_name":"lnxbil/docker-machine-driver-proxmox-ve","owner":"lnxbil","description":"Docker Machine driver for Proxmox VE","archived":false,"fork":false,"pushed_at":"2024-01-12T03:39:32.000Z","size":79,"stargazers_count":223,"open_issues_count":15,"forks_count":68,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-30T15:36:03.660Z","etag":null,"topics":["docker","docker-machine-driver","proxmox-ve"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lnxbil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-26T22:49:27.000Z","updated_at":"2025-03-11T13:55:28.000Z","dependencies_parsed_at":"2024-06-18T21:14:10.527Z","dependency_job_id":"6851bc9c-9797-4d23-af6e-79597bfc69d3","html_url":"https://github.com/lnxbil/docker-machine-driver-proxmox-ve","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/lnxbil/docker-machine-driver-proxmox-ve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnxbil%2Fdocker-machine-driver-proxmox-ve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnxbil%2Fdocker-machine-driver-proxmox-ve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnxbil%2Fdocker-machine-driver-proxmox-ve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnxbil%2Fdocker-machine-driver-proxmox-ve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lnxbil","download_url":"https://codeload.github.com/lnxbil/docker-machine-driver-proxmox-ve/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnxbil%2Fdocker-machine-driver-proxmox-ve/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266948272,"owners_count":24010904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-machine-driver","proxmox-ve"],"created_at":"2024-08-01T02:01:16.431Z","updated_at":"2025-07-25T03:18:47.120Z","avatar_url":"https://github.com/lnxbil.png","language":"Go","funding_links":[],"categories":["Go","docker"],"sub_categories":[],"readme":"# Docker Machine Driver for Proxmox VE\n\nThis driver can be used to kickstart a VM in Proxmox VE to be used with Docker/Docker Machine.\n\n* [Download](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/releases/tag/v4) and copy it into your `PATH` (don't forget to `chmod +x`) or build your own driver\n* Check if it works:\n\n        $ docker-machine create --driver proxmoxve --help | grep -c proxmox\n        35\n\n## Operation\n\nNow you have two modes of operation:\n* use an iso to install a Docker distribution (e.g. RancherOS)\n* use a previously created cloud-init-based image VM template as a base\n\nThere are also other options to customize your VM which are not shown here, so\nplease feel free to explore them with `docker-machine create --driver proxmoxve --help`\n\n### Preparing a special test user in PVE\n\nIf you want to test this docker-machine driver, i strongly recommend to secure it properly.\nBest way to do this to create a special user that has its own pool and storage for creating\nthe test machines. This corresponds to the examples below.\n\nHere is what I use (based on ZFS):\n\n* create a pool for use as `--proxmoxve-proxmox-pool docker-machine`\n\n        pvesh create /pools -poolid docker-machine\n\n* create an user `docker-machine` with password `D0ck3rS3cr3t`\n\n        pvesh create /access/users -userid docker-machine@pve -password D0ck3rS3cr3t\n\n* creating a special ZFS dataset and use it as PVE storage\n\n        zfs create -o refquota=50G rpool/docker-machine-test\n        zfs create rpool/docker-machine-test/iso\n        pvesh create /storage -storage docker-machine -type zfspool -pool rpool/docker-machine-test\n        pvesh create /storage -storage docker-machine-iso -type dir -path /rpool/docker-machine-test/iso -content iso\n        pvesh set /pools/docker-machine -storage docker-machine\n        pvesh set /pools/docker-machine -storage docker-machine-iso\n\n* set proper permissions for the user\n\n        pvesh set /access/acl -path /pool/docker-machine -roles PVEVMAdmin,PVEDatastoreAdmin,PVEPoolAdmin -users docker-machine@pve\n\nIf you have additional test storages, you can also add them easily:\n\n        pvesh set /pools/docker-machine -storage nfs\n        pvesh set /pools/docker-machine -storage lvm\n        pvesh set /pools/docker-machine -storage directory\n\nCeph is currently not directly tested by me, but there are [fine people](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/issues/32)\nout there wo tried it.\n\n\n### Clone VM\n\nThis approach uses a predefined VM template with cloud-init support to be cloned\nand used. There a lot of ways to do that, here is an adopted one\n(courtesy of [@travisghansen](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/pull/34#issuecomment-665277775)):\n\n```sh\n#!/bin/bash\n\nset -x\nset -e\n\nexport IMGID=9007\nexport BASE_IMG=\"debian-10-openstack-amd64.qcow2\"\nexport IMG=\"debian-10-openstack-amd64-${IMGID}.qcow2\"\nexport STORAGEID=\"docker-machine\"\n\nif [ ! -f \"${BASE_IMG}\" ];then\n  wget https://cloud.debian.org/images/cloud/OpenStack/current-10/debian-10-openstack-amd64.qcow2\nfi\n\nif [ ! -f \"${IMG}\" ];then\n  cp -f \"${BASE_IMG}\" \"${IMG}\"\nfi\n\n# prepare mounts\nguestmount -a ${IMG} -m /dev/sda1 /mnt/tmp/\nmount --bind /dev/ /mnt/tmp/dev/\nmount --bind /proc/ /mnt/tmp/proc/\n\n# get resolving working\nmv /mnt/tmp/etc/resolv.conf /mnt/tmp/etc/resolv.conf.orig\ncp -a --force /etc/resolv.conf /mnt/tmp/etc/resolv.conf\n\n# install desired apps\nchroot /mnt/tmp /bin/bash -c \"apt-get update\"\nchroot /mnt/tmp /bin/bash -c \"DEBIAN_FRONTEND=noninteractive apt-get install -y net-tools curl qemu-guest-agent nfs-common open-iscsi lsscsi sg3-utils multipath-tools scsitools\"\n\n# https://www.electrictoolbox.com/sshd-hostname-lookups/\nsed -i 's:#UseDNS no:UseDNS no:' /mnt/tmp/etc/ssh/sshd_config\n\nsed -i '/package-update-upgrade-install/d' /mnt/tmp/etc/cloud/cloud.cfg\n\ncat \u003e /mnt/tmp/etc/cloud/cloud.cfg.d/99_custom.cfg \u003c\u003c '__EOF__'\n#cloud-config\n\n# Install additional packages on first boot\n#\n# Default: none\n#\n# if packages are specified, this apt_update will be set to true\n#\n# packages may be supplied as a single package name or as a list\n# with the format [\u003cpackage\u003e, \u003cversion\u003e] wherein the specifc\n# package version will be installed.\n#packages:\n# - qemu-guest-agent\n# - nfs-common\n\nntp:\n  enabled: true\n\n# datasource_list: [ NoCloud, ConfigDrive ]\n__EOF__\n\ncat \u003e /mnt/tmp/etc/multipath.conf \u003c\u003c '__EOF__'\ndefaults {\n    user_friendly_names yes\n    find_multipaths yes\n}\n__EOF__\n\n# enable services\nchroot /mnt/tmp systemctl enable open-iscsi.service || true\nchroot /mnt/tmp systemctl enable multipath-tools.service || true\n\n# restore systemd-resolved settings\nmv /mnt/tmp/etc/resolv.conf.orig /mnt/tmp/etc/resolv.conf\n\n# umount everything\numount /mnt/tmp/dev\numount /mnt/tmp/proc\numount /mnt/tmp\n\n# create template\nqm create ${IMGID} --memory 512 --net0 virtio,bridge=vmbr0\nqm importdisk ${IMGID} ${IMG} ${STORAGEID} --format qcow2\nqm set ${IMGID} --scsihw virtio-scsi-pci --scsi0 ${STORAGEID}:vm-${IMGID}-disk-0\nqm set ${IMGID} --ide2 ${STORAGEID}:cloudinit\nqm set ${IMGID} --boot c --bootdisk scsi0\nqm set ${IMGID} --serial0 socket --vga serial0\nqm template ${IMGID}\n\n# set host cpu, ssh key, etc\nqm set ${IMGID} --scsihw virtio-scsi-pci\nqm set ${IMGID} --cpu host\nqm set ${IMGID} --agent enabled=1\nqm set ${IMGID} --autostart\nqm set ${IMGID} --onboot 1\nqm set ${IMGID} --ostype l26\nqm set ${IMGID} --ipconfig0 \"ip=dhcp\"\n```\n\nAdapt to fit your needs and run it on your Proxmox VE until it works without\nany problems and creates a template in your Proxmox VE. You may need to install\n`libguestfs-tools`.\n\nAfter the image is created, you can start to use the machine driver to create\nnew VMs:\n\n```sh\n#!/bin/sh\nset -ex\n\nexport PATH=$PWD:$PATH\n\nPVE_NODE=\"proxmox\"\nPVE_HOST=\"192.168.1.5\"\n\nPVE_USER=\"docker-machine\"\nPVE_REALM=\"pve\"\nPVE_PASSWD=\"D0ck3rS3cr3t\"\n\nPVE_STORAGE_NAME=\"${1:-docker-machine}\"\nPVE_POOL=\"docker-machine\"\n\nVM_NAME=\"docker-clone\"\n\ndocker-machine rm --force $VM_NAME \u003e/dev/null 2\u003e\u00261 || true\n\ndocker-machine --debug \\\n    create \\\n    --driver proxmoxve \\\n    --proxmoxve-proxmox-host $PVE_HOST \\\n    --proxmoxve-proxmox-node $PVE_NODE \\\n    --proxmoxve-proxmox-user-name $PVE_USER \\\n    --proxmoxve-proxmox-user-password $PVE_PASSWD \\\n    --proxmoxve-proxmox-realm $PVE_REALM \\\n    --proxmoxve-proxmox-pool $PVE_POOL \\\n    \\\n    --proxmoxve-provision-strategy clone \\\n    --proxmoxve-ssh-username 'debian' \\\n    --proxmoxve-ssh-password 'geheim' \\\n    --proxmoxve-vm-clone-vmid 9007 \\\n    \\\n    --proxmoxve-debug-resty \\\n    --proxmoxve-debug-driver \\\n    \\\n    $* \\\n    \\\n    $VM_NAME\n\neval $(docker-machine env $VM_NAME)\n\ndocker ps\n```\n\n\n### Rancher OS\n\n* Use a recent, e.g. `1.5.6` version of [RancherOS](https://github.com/rancher/os/releases) and copy the\n  `rancheros-proxmoxve-autoformat.iso` to your iso image storage on your PVE\n* Create a script with the following contents and *adapt to your needs*:\n\n```sh\nPVE_NODE=\"proxmox-docker-machine\"\nPVE_HOST=\"192.168.1.10\"\n\nPVE_USER=\"docker-machine\"\nPVE_REALM=\"pve\"\nPVE_PASSWD=\"D0ck3rS3cr3t\"\n\nPVE_STORAGE_NAME=\"docker-machine\"\nPVE_STORAGE_SIZE=\"4\"\nPVE_POOL=\"docker-machine\"\n\nSSH_USERNAME=\"docker\"\nSSH_PASSWORD=\"tcuser\"\n\nPVE_MEMORY=2\nPVE_CPU_CORES=4\nPVE_IMAGE_FILE=\"docker-machine-iso:iso/rancheros-proxmoxve-autoformat-v1.5.5.iso\"\nVM_NAME=\"docker-rancher\"\n\ndocker-machine rm --force $VM_NAME \u003e/dev/null 2\u003e\u00261 || true\n\ndocker-machine --debug \\\n    create \\\n    --driver proxmoxve \\\n    --proxmoxve-proxmox-host $PVE_HOST \\\n    --proxmoxve-proxmox-node $PVE_NODE \\\n    --proxmoxve-proxmox-user-name $PVE_USER \\\n    --proxmoxve-proxmox-user-password $PVE_PASSWD \\\n    --proxmoxve-proxmox-realm $PVE_REALM \\\n    --proxmoxve-proxmox-pool $PVE_POOL \\\n    \\\n    --proxmoxve-vm-storage-path $PVE_STORAGE_NAME \\\n    --proxmoxve-vm-storage-size $PVE_STORAGE_SIZE \\\n    --proxmoxve-vm-cpu-cores $PVE_CPU_CORES \\\n    --proxmoxve-vm-memory $PVE_MEMORY \\\n    --proxmoxve-vm-image-file \"$PVE_IMAGE_FILE\" \\\n    \\\n    --proxmoxve-ssh-username $SSH_USERNAME \\\n    --proxmoxve-ssh-password $SSH_PASSWORD \\\n    \\\n    --proxmoxve-debug-resty \\\n    --proxmoxve-debug-driver \\\n    \\\n    $VM_NAME\n\n\neval $(docker-machine env $VM_NAME)\n\ndocker ps\n```\n* Run the script\n\nAt the first run, it is advisable to not comment out the `debug` flags. If everything works as expected, you can remove them.\n\n## Changes\n\n### Version 4\n\n* [support for using clones+cloud-init](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/pull/34) (Thanks to @travisghansen)\n* [enable custom network bridge without vlan tag](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/pull/30) (Thanks to @guyguy333)\n* [including args to choice scsi model](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/pull/28) (Thanks to @bemanuel)\n* [fix remove error, add further flags](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/pull/26) (Thanks to @Psayker)\n\n### Version 3\n\n* [Renaming driver from `proxmox-ve` to `proxmoxve` due to identification problem with RancherOS's K8S implementation](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/pull/18) (Thanks to [`@Sellto` for reporting #16](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/issues/16))\n* fixing issue with created disk detection (Thanks to [`@Sellto` for reporting #16](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/issues/16))\n* [Add `IPAddress` property needed by rancher to know the ip address of the created VM](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/pull/18) (Thanks to `@Sellto`)\n* [Change the name of each flag for better display in the rancher `Node Templates`](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/pull/18) (Thanks to `@Sellto`)\n* [Add number of `CPU cores configuration paramater`](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/pull/18) (Thanks to `@Sellto`)\n* [LVM-thin fixes](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/pull/24) (Thanks to `@vstconsulting`)\n* [Bridge and VLAN tag support](https://github.com/lnxbil/docker-machine-driver-proxmox-ve/pull/22) (Thanks to `@bemanuel`)\n* Fixing filename detection including NFS support\n\n### Version 2\n\n* exclusive RancherOS support due to their special Proxmox VE iso files\n* adding wait cycles for asynchronous background tasks, e.g.  `create`, `stop` etc.\n* use one logger engine\n* add guest username, password and ssh-port as new command line arguments\n* more and potentially better error handling\n\n### Version 1\n\n* Initial Version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flnxbil%2Fdocker-machine-driver-proxmox-ve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flnxbil%2Fdocker-machine-driver-proxmox-ve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flnxbil%2Fdocker-machine-driver-proxmox-ve/lists"}