{"id":15779756,"url":"https://github.com/rgl/truenas-scale-vagrant","last_synced_at":"2026-05-05T07:32:51.024Z","repository":{"id":144182610,"uuid":"616149447","full_name":"rgl/truenas-scale-vagrant","owner":"rgl","description":"A TrueNAS SCALE vagrant box","archived":false,"fork":false,"pushed_at":"2024-06-14T18:08:29.000Z","size":629,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-31T11:06:18.218Z","etag":null,"topics":["iscsi","iscsi-boot","packer","truenas","truesnas-scale","vagrant"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-03-19T18:46:04.000Z","updated_at":"2024-06-14T18:08:33.000Z","dependencies_parsed_at":"2024-06-14T19:28:35.059Z","dependency_job_id":"40cd5172-2070-492a-bd6d-51526524a85a","html_url":"https://github.com/rgl/truenas-scale-vagrant","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rgl/truenas-scale-vagrant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Ftruenas-scale-vagrant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Ftruenas-scale-vagrant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Ftruenas-scale-vagrant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Ftruenas-scale-vagrant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgl","download_url":"https://codeload.github.com/rgl/truenas-scale-vagrant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Ftruenas-scale-vagrant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32640533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"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":["iscsi","iscsi-boot","packer","truenas","truesnas-scale","vagrant"],"created_at":"2024-10-04T18:21:23.684Z","updated_at":"2026-05-05T07:32:51.010Z","avatar_url":"https://github.com/rgl.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n\nThis builds a [TrueNAS SCALE](https://www.truenas.com/truenas-scale/) vagrant box.\n\nThis also includes an example environment with:\n\n* TrueNAS SCALE server.\n    * `tank` storage pool.\n    * `tank/sw` filesystem dataset.\n    * `tank/ubuntu-data` zvol dataset.\n    * `tank/windows-data` zvol dataset.\n    * `tank/debian-live-boot` zvol dataset.\n    * `tank/ubuntu-boot` zvol dataset.\n    * `tank/opensuse-boot` zvol dataset.\n    * `tank/windows-boot` zvol dataset.\n    * `tank/k3s/v/pvc-` prefixed zvol datasets.\n    * `sw` SMB share.\n        * `tank/sw` dataset.\n    * `ubuntu` iSCSI target share.\n        * LUN 0: `tank/ubuntu-data` dataset.\n    * `windows` iSCSI target share.\n        * LUN 0: `tank/windows-data` dataset.\n    * `debian-live-boot` iSCSI target read-only share.\n        * LUN 0: `tank/debian-live-boot` dataset.\n    * `ubuntu-boot` iSCSI target share.\n        * LUN 0: `tank/ubuntu-boot` dataset.\n    * `opensuse-boot` iSCSI target share.\n        * LUN 0: `tank/opensuse-boot` dataset.\n    * `windows-boot` iSCSI target share.\n        * LUN 0: `tank/windows-boot` dataset.\n    * `csi-k3s-pvc-` prefixed iSCSI target shares.\n        * LUN 0: `tank/k3s/v/pvc-` prefixed dataset for a Kubernetes PVC.\n* Ubuntu client.\n    * `ubuntu-data` iSCSI LUN 0 initialized and mounted at `/mnt/ubuntu-data`.\n* Kubernetes and Ubuntu client.\n    * iSCSI LUN initialized and mounted for a Kubernetes Persistent Volume Claims (PVC).\n* Windows client.\n    * `windows-data` iSCSI LUN 0 initialized and mounted at `D:`.\n* iPXE and Debian live client.\n    * `debian-live-boot` iSCSI LUN 0 used as the boot disk.\n* iPXE and Ubuntu client.\n    * `ubuntu-boot` iSCSI LUN 0 used as the boot disk.\n* iPXE and openSUSE client.\n    * `opensuse-boot` iSCSI LUN 0 used as the boot disk.\n* iPXE and Windows client.\n    * `windows-boot` iSCSI LUN 0 used as the boot disk.\n\n# Usage\n\nAdd the following entries to your machine `hosts` file:\n\n```\n10.10.0.2  truenas.example.com\n10.10.0.11 git.example.com\n```\n\nDepending on your hypervisor, build and install the base box and start the\nexample environment:\n\n* [libvirt/kvm/linux](#libvirt-usage)\n* [VMware vSphere](#vmware-vsphere-usage)\n\nAfter the example environment is running, open the Web UI:\n\nhttp://truenas.example.com\n\nUse the Web API:\n\n```bash\ntruenas_api_base_url='http://truenas.example.com/api/v2.0'\nfunction api {\n    # see http://truenas.example.com/api/docs/#restful\n    # NB to use an api key, replace --user, --password and --auth-no-challenge,\n    #    with --header, e.g.:\n    #       wget -qO- --header \"Authorization: Bearer $api_key\" \"$@\"\n    wget -qO- --user admin --password admin --auth-no-challenge \"$truenas_api_base_url/$@\"\n}\napi system/state | jq -r\napi system/general | jq\napi disk | jq\napi pool | jq\napi pool/dataset | jq\napi sharing/smb | jq\napi iscsi/portal | jq\napi iscsi/target | jq\napi iscsi/extent | jq\napi iscsi/targetextent | jq\napi iscsi/global/sessions | jq\n```\n\nAccess the gitea example kubernetes application (which uses iSCSI persistent\nstorage) and login with the `gitea` username and the `abracadabra` password:\n\nhttp://git.example.com\n\nList this repository dependencies (and which have newer versions):\n\n```bash\nGITHUB_COM_TOKEN='YOUR_GITHUB_PERSONAL_TOKEN' ./renovate.sh\n```\n\n## libvirt usage\n\nInstall [`packer`](https://github.com/hashicorp/packer), [`vagrant`](https://github.com/hashicorp/vagrant), [`vagrant-libvirt`](https://github.com/vagrant-libvirt/vagrant-libvirt), and [`libvirt`](https://github.com/libvirt/libvirt) (see the [rgl/my-ubuntu-ansible-playbooks repository](https://github.com/rgl/my-ubuntu-ansible-playbooks)).\n\nInstall the [Ubuntu 22.04 box](https://github.com/rgl/ubuntu-vagrant).\n\nInstall the [Windows 2022 box](https://github.com/rgl/windows-vagrant).\n\nBuild the box and add it to the local vagrant installation:\n\n```bash\ntime make build-libvirt\nvagrant box add -f truenas-scale-24.04-amd64 truenas-scale-24.04-amd64-libvirt.box.json\n```\n\nDownload the example ISOs:\n\n```bash\npushd example\nwget -O openSUSE-Leap-15.4-NET-x86_64-Media.iso \\\n    https://download.opensuse.org/distribution/leap/15.4/iso/openSUSE-Leap-15.4-NET-x86_64-Media.iso\n# see https://github.com/rgl/windows-evaluation-isos-scraper/blob/main/data/windows-2022.json\nwget -O windows-2022-amd64.iso \\\n    https://software-static.download.prss.microsoft.com/sg/download/888969d5-f34g-4e03-ac9d-1f9786c66749/SERVER_EVAL_x64FRE_en-us.iso\nwget -O virtio-win-0.1.240.iso \\\n    https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.240-1/virtio-win-0.1.240.iso\npopd\n```\n\nStart the common VMs:\n\n```bash\npushd example\ntime vagrant up --provider=libvirt --no-destroy-on-error --no-tty truenas pixie\n```\n\nDepending on what you want to try next, follow the sections:\n\n* [ubuntu](#ubuntu)\n* [k3s](#k3s)\n* [windows](#windows)\n* [debian_live_boot](#debian_live_boot)\n* [ubuntu_boot](#ubuntu_boot)\n* [opensuse_boot](#opensuse_boot)\n* [windows_boot](#windows_boot)\n\n### ubuntu\n\nStart:\n\n```bash\ntime vagrant up --provider=libvirt --no-destroy-on-error --no-tty ubuntu\n```\n\nEnter the `ubuntu` VM, and write something to the shared volume:\n\n```bash\nvagrant ssh ubuntu\nsudo -i\necho \"hello, world!\" \u003e/mnt/ubuntu-data/message.txt\nll /mnt/ubuntu-data\n```\n\n### k3s\n\nStart:\n\n```bash\ntime vagrant up --provider=libvirt --no-destroy-on-error --no-tty k3s\n```\n\nEnter the `k3s` VM:\n\n```bash\nvagrant ssh k3s\nsudo -i\n```\n\nList all the active iSCSI sessions:\n\n```bash\niscsiadm -m session\n```\n\nList all the Kubernetes Storage Class (SC), Persistent Volume Claim (PVC) and Persistent Volume (PV) objects:\n\n```bash\nkubectl get sc,pvc,pv -A\n```\n\n### windows\n\nStart:\n\n```bash\ntime vagrant up --provider=libvirt --no-destroy-on-error --no-tty windows\n```\n\nEnter the `windows` VM, and write something to the shared volume:\n\n```bash\nvagrant ssh windows -- pwsh\nSet-Content d:/message.txt \"hello, world!\"\nGet-ChildItem d:/\n```\n\n### debian_live_boot\n\nStart:\n\n```bash\ntime vagrant up --provider=libvirt --no-destroy-on-error --no-tty debian_live_boot\n```\n\n### ubuntu_boot\n\nStart:\n\n```bash\ntime vagrant up --provider=libvirt --no-destroy-on-error --no-tty ubuntu_boot\n```\n\nLogin into the VM:\n\n```bash\nvagrant ssh ubuntu_boot\nsudo -i\n```\n\nDump the IP configuration:\n\n```bash\nip addr\n```\n```\n1: lo: \u003cLOOPBACK,UP,LOWER_UP\u003e mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000\n    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\n    inet 127.0.0.1/8 scope host lo\n       valid_lft forever preferred_lft forever\n    inet6 ::1/128 scope host\n       valid_lft forever preferred_lft forever\n2: eth0: \u003cBROADCAST,MULTICAST,UP,LOWER_UP\u003e mtu 1500 qdisc pfifo_fast state UP group default qlen 1000\n    link/ether 52:54:00:da:4c:51 brd ff:ff:ff:ff:ff:ff\n    altname enp5s0\n    inet 192.168.121.202/24 metric 100 brd 192.168.121.255 scope global eth0\n       valid_lft forever preferred_lft forever\n    inet6 fe80::5054:ff:feda:4c51/64 scope link\n       valid_lft forever preferred_lft forever\n3: eth1: \u003cBROADCAST,UP,LOWER_UP\u003e mtu 9000 qdisc pfifo_fast state UP group default qlen 1000\n    link/ether 08:00:27:00:00:21 brd ff:ff:ff:ff:ff:ff\n    altname enp6s0\n    inet 10.10.0.21/24 brd 10.10.0.255 scope global eth1\n       valid_lft forever preferred_lft forever\n    inet6 fe80::a00:27ff:fe00:21/64 scope link\n       valid_lft forever preferred_lft forever\n```\n\nDump the iSCSI target from the iBFT:\n\n```bash\ncat /sys/firmware/ibft/target0/target-name\n```\n```\niqn.2005-10.org.freenas.ctl:ubuntu-boot\n```\n\nDump the iSCSI initiator name from the iBFT:\n\n```bash\ncat /sys/firmware/ibft/initiator/initiator-name\n```\n```\niqn.2010-04.org.ipxe:080027000021\n```\n\nDump the iSCSI initiator name from the iscsid configuration:\n\n```bash\ncat /etc/iscsi/initiatorname.iscsi\n```\n```\nInitiatorName=iqn.2004-10.com.ubuntu:01:1f309ecf3be\n```\n\nShow the open iSCSI sessions:\n\n```bash\niscsiadm -m session         # show brief information.\niscsiadm -m session -P 3    # show detailed information.\n```\n```\ntcp: [1] 10.10.0.2:3260,1 iqn.2005-10.org.freenas.ctl:ubuntu-boot (non-flash)\n```\n\nShow the detected partitions:\n\n```bash\nfdisk -l\n```\n```\nDisk /dev/sda: 8 GiB, 8589934592 bytes, 16777216 sectors\nDisk model: iSCSI Disk\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical/physical): 512 bytes / 16384 bytes\nI/O size (minimum/optimal): 16384 bytes / 16384 bytes\nDisklabel type: dos\nDisk identifier: 0x9d200a48\n\nDevice     Boot Start      End  Sectors Size Id Type\n/dev/sda1        2048 16777215 16775168   8G 83 Linux\n```\n\nShow the free space:\n\n```bash\ndf -h\n```\n```\nFilesystem      Size  Used Avail Use% Mounted on\ntmpfs           198M  1.1M  197M   1% /run\n/dev/sda1       7.8G  4.3G  3.2G  58% /\ntmpfs           988M     0  988M   0% /dev/shm\ntmpfs           5.0M     0  5.0M   0% /run/lock\ntmpfs           198M  4.0K  198M   1% /run/user/1000\n```\n\n### opensuse_boot\n\nStart:\n\n```bash\ntime vagrant up --provider=libvirt --no-destroy-on-error --no-tty opensuse_boot\n```\n\nOpen the VM console.\n\nAdvance the installer to the `Disk Activation` page:\n\n![](example/opensuse-boot-disk-activation-0.png)\n\nClick the `Network Configuration...` button. You should now see the `Network Settings` page:\n\n![](example/opensuse-boot-network-settings-0.png)\n\nSelect the `Ethernet Card 0` (`eth1`), and click the `Edit` button. You should now see the `Network Card Setup` page:\n\n![](example/opensuse-boot-network-card-setup-0.png)\n\nClick the `Dynamic Address` radio button, and select `DHCP`.\n\nClick the `Next` button. You should now see the `Network Settings` page:\n\n![](example/opensuse-boot-network-settings-1.png)\n\nEnsure both network cards are configured with `DHCP`.\n\nClick the `Next` button. Eventually, you should see the `Disk Activation` page again:\n\n![](example/opensuse-boot-disk-activation-1.png)\n\nClick the `Configure iSCSI Disks` button. You should see the `iSCSI Initiator Overview` page:\n\n![](example/opensuse-boot-iscsi-initiator-service-page.png)\n\nEnsure the following properties are set:\n\n| Property       | Value                               |\n|----------------|-------------------------------------|\n| Initiator Name | `iqn.2010-04.org.ipxe:080027000020` |\n| Offload Card   | `default (Software)`                |\n\nClick the `Connected Targets` tab. Then, click the `Add` button. Then set the properties as:\n\n![](example/opensuse-boot-iscsi-target.png)\n\n| Property       | Value       |\n|----------------|-------------|\n| IP Address     | `10.10.0.2` |\n| Port           | `3260`      |\n\nClick the `Next` button. You should see the page:\n\n![](example/opensuse-boot-iscsi-volume.png)\n\nSelect the `iqn.2005.org.freenas.ctl:opensuse-boot` target name, and click the `Connect` button.\n\nSet as:\n\n![](example/opensuse-boot-iscsi-volume-config.png)\n\nClick the `Next` button, then click the `Cancel` button. You should now be back at the `Disk Activation` page:\n\n![](example/opensuse-boot-disk-activation-1.png)\n\nClick the `Next` button. You should advance the installer until the `Disk` `Suggested Partitioning` page:\n\n![](example/opensuse-boot-disk-suggested-partitioning.png)\n\nClick the `Next` button.\n\nAdvance the installer until the installation finishes.\n\nPower-off the VM.\n\nConfigure the VM to boot from the second ethernet interface as:\n\n![](example/opensuse-boot-vm-boot-from-network.png)\n\nStart the VM.\n\nLogin into the VM.\n\nDump the IP configuration:\n\n```bash\nip addr\n```\n```\n1: lo: \u003cLOOPBACK,UP,LOWER_UP\u003e mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000\n    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\n    inet 127.0.0.1/8 scope host lo\n       valid_lft forever preferred_lft forever\n    inet6 ::1/128 scope host\n       valid_lft forever preferred_lft forever\n2: eth0: \u003cBROADCAST,MULTICAST,UP,LOWER_UP\u003e mtu 1500 qdisc pfifo_fast state UP group default qlen 1000\n    link/ether 52:54:00:26:21:08 brd ff:ff:ff:ff:ff:ff\n    altname enp7s0\n    inet 192.168.121.82/24 brd 192.168.121.255 scope global eth0\n       valid_lft forever preferred_lft forever\n    inet6 fe80::5054:ff:fe26:2108/64 scope link\n       valid_lft forever preferred_lft forever\n3: eth1: \u003cBROADCAST,MULTICAST,UP,LOWER_UP\u003e mtu 9000 qdisc pfifo_fast state UP group default qlen 1000\n    link/ether 08:00:27:00:00:20 brd ff:ff:ff:ff:ff:ff\n    altname enp8s0\n    inet 10.10.0.20/24 brd 10.10.0.255 scope global eth1\n       valid_lft forever preferred_lft forever\n    inet6 fe80::a00:27ff:fe00:20/64 scope link\n       valid_lft forever preferred_lft forever\n```\n\nDump the iSCSI initiator name from the iBFT:\n\n```bash\ncat /sys/firmware/ibft/initiator/initiator-name\n```\n```\niqn.2010-04.org.ipxe:080027000020\n```\n\nDump the iSCSI target from the iBFT:\n\n```bash\ncat /sys/firmware/ibft/target0/target-name\n```\n```\niqn.2005-10.org.freenas.ctl:opensuse-boot\n```\n\nDump the iSCSI initiator name from the iscsid configuration:\n\n```bash\ncat /etc/iscsi/initiatorname.iscsi\n```\n```\nInitiatorName=iqn.2010-04.org.ipxe:080027000020\n```\n\nShow the open iSCSI sessions:\n\n```bash\niscsiadm -m session\n```\n```\ntcp: [1] 10.10.0.2:3260,1 iqn.2005-10.org.freenas.ctl:opensuse-boot (non-flash)\n```\n\nShow the detected partitions:\n\n```bash\nfdisk -l\n```\n```\nDisk /dev/sda: 16 GiB, 17179869184 bytes, 33554432 sectors\nDisk model: iSCSI Disk\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical/physical): 512 bytes / 16384 bytes\nI/O size (minimum/optimal): 16384 bytes / 16384 bytes\nDisklabel type: gpt\nDisk identifier: B69FEE1E-B688-4E93-8F45-0C3B98C48752\n\nDevice     Start      End  Sectors Size Type\n/dev/sda1   2048    18431    16384   8M BIOS boot\n/dev/sda2  18432 33554398 33535967  16G Linux filesystem\n```\n\nShow the free space:\n\n```bash\ndf -h\n```\n```\nFilesystem      Size  Used Avail Use% Mounted on\ndevtmpfs        4.0M     0  4.0M   0% /dev\ntmpfs           985M     0  985M   0% /dev/shm\ntmpfs           394M  6.0M  388M   2% /run\ntmpfs           4.0M     0  4.0M   0% /sys/fs/cgroup\n/dev/sda2        16G  1.9G   14G  13% /\n/dev/sda2        16G  1.9G   14G  13% /boot/grub2/i386-pc\n/dev/sda2        16G  1.9G   14G  13% /home\n/dev/sda2        16G  1.9G   14G  13% /boot/grub2/x86_64-efi\n/dev/sda2        16G  1.9G   14G  13% /root\n/dev/sda2        16G  1.9G   14G  13% /opt\n/dev/sda2        16G  1.9G   14G  13% /srv\n/dev/sda2        16G  1.9G   14G  13% /tmp\n/dev/sda2        16G  1.9G   14G  13% /usr/local\n/dev/sda2        16G  1.9G   14G  13% /var\ntmpfs           197M     0  197M   0% /run/user/1000\n```\n\n### windows_boot\n\nStart:\n\n```bash\ntime vagrant up --provider=libvirt --no-destroy-on-error --no-tty windows_boot\n```\n\nOpen the VM console.\n\nFocus the PowerShell window.\n\nShow iSCSI information:\n\n```powershell\nnetsh interface ipv4 show interfaces\niscsicli ReportTargetMappings\nGet-Disk | Where-Object { $_.BusType -eq 'iSCSI' } | Format-Table -AutoSize\nGet-IscsiSession\n```\n\nMount the Windows Setup ISO:\n\n```powershell\nnet use s: \\\\10.10.0.2\\sw vagrant /user:vagrant\nMount-DiskImage s:\\windows-2022-amd64.iso\n```\n\nStart the Windows Setup:\n\n```powershell\nd:\\setup.exe /noreboot\n```\n\nProceed with the installation until you come back to the powershell prompt.\n\nLogin into the `pixie` VM and reconfigure the windows-boot iPXE settings:\n\n```bash\nvagrant ssh pixie\nsudo -i\nvim /var/pixie/boot-080027000023.ipxe\n# uncomment the sanboot ${target_boot} line,\n# and comment everything after it.\n```\n\nIn the windows_boot VM, reboot the machine:\n\n```powershell\nwpeutil reboot\n```\n\nWindows should now boot from the iSCSI disk.\n\nLogin into Windows and install the guest tools:\n\n```powershell\nnet use s: \\\\10.10.0.2\\sw vagrant /user:vagrant\nMount-DiskImage s:\\virtio-win-0.1.240.iso\nd:\\virtio-win-guest-tools.exe\n```\n\n## VMware vSphere usage\n\nInstall [`govc`](https://github.com/vmware/govmomi) and [`vagrant-vsphere`](https://github.com/nsidc/vagrant-vsphere) (see the [rgl/my-ubuntu-ansible-playbooks repository](https://github.com/rgl/my-ubuntu-ansible-playbooks)).\n\nApply the [vagrant-vsphere plugin ip-wait patch](https://github.com/rgl/my-ubuntu-ansible-playbooks/blob/main/roles/vagrant/files/vagrant-vsphere-ip-wait.patch).\n\nInstall the [Ubuntu 22.04 box](https://github.com/rgl/ubuntu-vagrant).\n\nInstall the [Windows 2022 box](https://github.com/rgl/windows-vagrant).\n\nSet your vSphere details, and test the connection to vSphere:\n\n```bash\ncat \u003esecrets.sh \u003c\u003cEOF\nexport GOVC_INSECURE='1'\nexport GOVC_HOST='vsphere.local'\nexport GOVC_URL=\"https://$GOVC_HOST/sdk\"\nexport GOVC_USERNAME='administrator@vsphere.local'\nexport GOVC_PASSWORD='password'\nexport GOVC_DATACENTER='Datacenter'\nexport GOVC_CLUSTER='Cluster'\nexport GOVC_DATASTORE='Datastore'\nexport VSPHERE_OS_ISO=\"[$GOVC_DATASTORE] iso/TrueNAS-SCALE-24.04.1.1.iso\"\nexport VSPHERE_ESXI_HOST='esxi.local'\nexport VSPHERE_TEMPLATE_FOLDER='test/templates'\nexport VSPHERE_TEMPLATE_NAME=\"$VSPHERE_TEMPLATE_FOLDER/truenas-scale-24.04-amd64-vsphere\"\nexport VSPHERE_UBUNTU_TEMPLATE_NAME=\"$VSPHERE_TEMPLATE_FOLDER/ubuntu-22.04-amd64-vsphere\"\nexport VSPHERE_WINDOWS_TEMPLATE_NAME=\"$VSPHERE_TEMPLATE_FOLDER/windows-2022-amd64-vsphere\"\nexport VSPHERE_VM_FOLDER='test'\nexport VSPHERE_VM_NAME='truenas-scale-24.04-vagrant-example'\nexport VSPHERE_PIXIE_VM_NAME='ubuntu-22.04-pixie-vagrant-example'\nexport VSPHERE_UBUNTU_VM_NAME='ubuntu-22.04-vagrant-example'\nexport VSPHERE_K3S_VM_NAME='ubuntu-22.04-k3s-vagrant-example'\nexport VSPHERE_WINDOWS_VM_NAME='windows-2022-vagrant-example'\n# NB ensure that the associated vSwitch can use an 9000 MTU or modify the\n#    CONFIG_STORAGE_MTU variable value inside the Vagrantfile file to\n#    1500.\nexport VSPHERE_VLAN='packer'\nexport VSPHERE_IP_WAIT_ADDRESS='0.0.0.0/0'\n# set the credentials that the guest will use\n# to connect to this host smb share.\n# NB you should create a new local user named _vagrant_share\n#    and use that one here instead of your user credentials.\n# NB it would be nice for this user to have its credentials\n#    automatically rotated, if you implement that feature,\n#    let me known!\nexport VAGRANT_SMB_USERNAME='_vagrant_share'\nexport VAGRANT_SMB_PASSWORD=''\nEOF\nsource secrets.sh\n# see https://github.com/vmware/govmomi/blob/master/govc/USAGE.md\ngovc version\ngovc about\ngovc datacenter.info # list datacenters\ngovc find # find all managed objects\n```\n\nDownload the TrueNAS SCALE ISO (you can find the full iso URL in the [truenas-scale.pkr.hcl](truenas-scale.pkr.hcl) file) and place it inside the datastore at the path defined by the `VSPHERE_OS_ISO` environment variable (its value will end-up in the `vsphere_iso_url` packer user variable that is defined inside the [packer template](truenas-scale-vsphere.pkr.hcl)).\n\nBuild the box and add it to the local vagrant installation:\n\n```bash\nsource secrets.sh\ntime make build-vsphere\n```\n\nStart the example:\n\n```bash\ncd example\ntime vagrant up --provider=vsphere --no-destroy-on-error --no-tty\n```\n\n# Packer boot_steps\n\nAs TrueNAS SCALE does not have a documented way to be pre-seeded, this environment has to\nanswer all the installer questions through the packer `boot_steps` interface. This is\nquite fragile, so be aware when you change anything. The following table describes the\ncurrent steps and corresponding answers.\n\n| step                                          | boot_steps                                                                                |\n|----------------------------------------------:|-------------------------------------------------------------------------------------------|\n| select Start TrueNAS Scale Installation       | `\u003center\u003e`                                                                                 |\n| wait for the boot to finish                   | `\u003cwait1m\u003e`                                                                                |\n| select 1 Install/Upgrade                      | `\u003center\u003e\u003cwait3s\u003e`                                                                         |\n| choose destination media                      | ` \u003center\u003e\u003cwait3s\u003e`                                                                        |\n| proceed with the installation                 | `\u003center\u003e\u003cwait3s\u003e`                                                                         |\n| select 1 Administrative user (admin)          | `1\u003center\u003e\u003cwait3s\u003e`                                                                        |\n| set the password                              | `admin\u003ctab\u003e\u003cwait3s\u003e`                                                                      |\n| confirm the password                          | `admin\u003center\u003e\u003cwait3s\u003e`                                                                    |\n| do not create swap partition on boot devices  | `N\u003cwait3s\u003e` (only set when `var.disk_size` is 64GB+)                                      |\n| wait for the installation to finish           | `\u003cwait5m\u003e`                                                                                |\n| accept the installation finished prompt       | `\u003center\u003e\u003cwait3s\u003e`                                                                         |\n| select 3 Reboot System                        | `3\u003center\u003e`                                                                                |\n| wait for the reboot to finish                 | `\u003cwait5m\u003e`                                                                                |\n| select 6 Open TrueNAS CLI Shell               | `6\u003center\u003e\u003cwait3s\u003e`                                                                        |\n| configure the admin sudo command              | `account user update uid_or_username=admin sudo_commands_nopasswd=\"ALL\"\u003center\u003e\u003cwait3s\u003e`   |\n| enable ssh admin login                        | `service ssh update adminlogin=true\u003center\u003e\u003cwait3s\u003e`                                       |\n| enable ssh password authentication            | `service ssh update passwordauth=true\u003center\u003e\u003cwait3s\u003e`                                     |\n| automatically start the ssh service on boot   | `service update id_or_name=ssh enable=true\u003center\u003e\u003cwait3s\u003e`                                |\n| start the ssh service                         | `service start service=ssh\u003center\u003e\u003cwait3s\u003eq\u003cwait3s\u003e`                                       |\n| exit the TrueNAS CLI Shell                    | `exit\u003center\u003e\u003cwait15s\u003e`                                                                    |\n\n# Reference\n\n* [RFC7143: Internet Small Computer System Interface (iSCSI) Protocol](https://www.rfc-editor.org/rfc/rfc7143)\n* [OpenZFS (Wikipedia)](https://en.wikipedia.org/wiki/OpenZFS)\n* [OpenZFS (TrueNAS)](https://www.truenas.com/zfs/)\n* [openzfs/zfs repository](https://github.com/openzfs/zfs)\n* [Using the TrueNAS CLI Shell](https://www.truenas.com/docs/scale/scaletutorials/truenasclishell/)\n* [midcli: TrueNAS SCALE CLI](https://github.com/truenas/midcli)\n* [truenas-installer: TrueNAS SCALE Installer](https://github.com/truenas/truenas-installer/blob/TS-24.04.1.1/usr/sbin/truenas-install)\n* [democratic-csi: TrueNAS SCALE Kubernetes CSI provider](https://github.com/democratic-csi/democratic-csi)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Ftruenas-scale-vagrant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgl%2Ftruenas-scale-vagrant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Ftruenas-scale-vagrant/lists"}