{"id":14986177,"url":"https://github.com/pr3sto/vagrant-port-range","last_synced_at":"2026-02-24T20:45:49.603Z","repository":{"id":59158986,"uuid":"114551056","full_name":"pr3sto/vagrant-port-range","owner":"pr3sto","description":"Vagrant plugin for mapping forwarded ports using range of host ports","archived":false,"fork":false,"pushed_at":"2018-10-17T08:09:00.000Z","size":19,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-06T05:40:12.193Z","etag":null,"topics":["vagrant","vagrant-plugin"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/pr3sto.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}},"created_at":"2017-12-17T16:22:54.000Z","updated_at":"2018-10-17T08:09:01.000Z","dependencies_parsed_at":"2022-09-13T20:10:26.081Z","dependency_job_id":null,"html_url":"https://github.com/pr3sto/vagrant-port-range","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pr3sto/vagrant-port-range","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pr3sto%2Fvagrant-port-range","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pr3sto%2Fvagrant-port-range/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pr3sto%2Fvagrant-port-range/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pr3sto%2Fvagrant-port-range/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pr3sto","download_url":"https://codeload.github.com/pr3sto/vagrant-port-range/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pr3sto%2Fvagrant-port-range/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29799246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T19:56:48.334Z","status":"ssl_error","status_checked_at":"2026-02-24T19:55:43.372Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["vagrant","vagrant-plugin"],"created_at":"2024-09-24T14:12:29.219Z","updated_at":"2026-02-24T20:45:49.569Z","avatar_url":"https://github.com/pr3sto.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vagrant-port-range\n\n[![Gem Version](https://badge.fury.io/rb/vagrant-port-range.svg)](https://badge.fury.io/rb/vagrant-port-range)\n\nvagrant-port-range is a Vagrant plugin for mapping forwarded ports using range of host ports.\n\n## Installation\n\n```console\nfoo@bar:~$ vagrant plugin install vagrant-port-range\n```\n\n## Usage\n\nThe plugin is loaded automatically once installed.\n\n## Configuration\n\n### config.portrange.forwarded_port\n\nUse [standart options from forwarded_port](https://www.vagrantup.com/docs/networking/forwarded_ports.html), except for next options:\n* Instead of **host** use **host_range** with desired port range. Plugin will automatically pick free port from given range and insert it into **host** option.\n* **attempts** - number of attempts for plugin to try get free port from given range. Plugin will try to randomly pick port and check whether it is free or not.\n\n## Example\n\nVagrantfile:\n\n```ruby\n# -*- mode: ruby -*-\n# vi: set ft=ruby :\n\nVagrant.configure(\"2\") do |config|\n  config.portrange.forwarded_port guest: 6901, host_range: [3000, 4100], attempts: 10\n  config.portrange.forwarded_port guest: 8080, host_range: [3000, 4100], attempts: 10\n  config.vm.provider \"docker\" do |d|\n    d.image = \"consol/ubuntu-xfce-vnc\"\n  end\nend\n\n```\n\nThe result:\n\n```console\nfoo@bar:~$ vagrant up\n\nBringing machine 'default' up with 'docker' provider...\n==\u003e default: [vagrant-port-range] Free port found: 4022\n==\u003e default: [vagrant-port-range] Free port found: 3744\n==\u003e default: Creating the container...\n    default:   Name: vagrantportrange_default_1514061829\n    default:  Image: consol/ubuntu-xfce-vnc\n    default:   Port: 4022:6901\n    default:   Port: 3744:8080\n    default:  \n    default: Container created: b01667fcb339703a\n==\u003e default: Starting container...\n\nfoo@bar:~$\n```\n\nIn case of situation when all ports from range are in use:\n\n```ruby\n# -*- mode: ruby -*-\n# vi: set ft=ruby :\n\nVagrant.configure(\"2\") do |config|\n  config.portrange.forwarded_port guest: 6901, host_range: [80, 81], attempts: 10\n  config.vm.provider \"docker\" do |d|\n    d.image = \"consol/ubuntu-xfce-vnc\"\n  end\nend\n\n```\n\n```console\n# make them busy\nfoo@bar:~$ python3 -m http.server 80\nfoo@bar:~$ python3 -m http.server 81\n\nfoo@bar:~$ vagrant up\n\nBringing machine 'default' up with 'docker' provider...\n==\u003e default: [vagrant-port-range] Free port from range [80, 81] not found\n\nfoo@bar:~$\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpr3sto%2Fvagrant-port-range","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpr3sto%2Fvagrant-port-range","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpr3sto%2Fvagrant-port-range/lists"}