Roots Discourse

Vagrant share / ngrok

I’m trying to use vagrant share with a trellis developer environment so I can share it other.

When i run vagrant share i get a warning telling me the machine has no static Ip associated. but when i try vagrant share --http 80 --name site.test i get far as Creating vagrant share session… and nothing else happens.

Any idea to solve it or another way to share it on local network?

Edit: Just tryed ngrok http -host-header=rewrite site.tst:80 and it works but get problems with css and js on the site

➜  trellis vagrant share --http 80 --name site.test --debug
 INFO global: RubyGems version: 2.6.14.4
 INFO global: VAGRANT_INSTALLER_ENV="1"
 INFO global: VAGRANT_LOG="debug"
-2.2.6/plugins/commands/winrm/plugin.rb
-2.2.6/plugins/commands/version/plugin.rb
-2.2.6/plugins/commands/login/plugin.rb
-2.2.6/plugins/commands/global-status/plugin.rb
-2.2.6/plugins/commands/provision/plugin.rb
-2.2.6/plugins/commands/ssh_config/plugin.rb
-2.2.6/plugins/commands/provider/plugin.rb
-2.2.6/plugins/commands/upload/plugin.rb
-2.2.6/plugins/commands/package/plugin.rb
-2.2.6/plugins/commands/cloud/plugin.rb
-2.2.6/plugins/commands/halt/plugin.rb
-2.2.6/plugins/commands/snapshot/plugin.rb
-2.2.6/plugins/commands/cap/plugin.rb
-2.2.6/plugins/commands/winrm_config/plugin.rb
-2.2.6/plugins/commands/reload/plugin.rb
-2.2.6/plugins/commands/plugin/plugin.rb
-2.2.6/plugins/commands/validate/plugin.rb
-2.2.6/plugins/commands/up/plugin.rb
-2.2.6/plugins/commands/suspend/plugin.rb
-2.2.6/plugins/commands/resume/plugin.rb
-2.2.6/plugins/commands/list-commands/plugin.rb
-2.2.6/plugins/commands/init/plugin.rb
-2.2.6/plugins/commands/push/plugin.rb
-2.2.6/plugins/commands/ssh/plugin.rb
-2.2.6/plugins/commands/help/plugin.rb
-2.2.6/plugins/commands/destroy/plugin.rb
-2.2.6/plugins/commands/status/plugin.rb
-2.2.6/plugins/commands/rdp/plugin.rb
-2.2.6/plugins/commands/port/plugin.rb
-2.2.6/plugins/commands/box/plugin.rb
-2.2.6/plugins/commands/powershell/plugin.rb
-2.2.6/plugins/provisioners/shell/plugin.rb
-2.2.6/plugins/provisioners/cfengine/plugin.rb
-2.2.6/plugins/provisioners/puppet/plugin.rb
-2.2.6/plugins/provisioners/docker/plugin.rb
-2.2.6/plugins/provisioners/ansible/plugin.rb
-2.2.6/plugins/provisioners/salt/plugin.rb
-2.2.6/plugins/provisioners/file/plugin.rb
-2.2.6/plugins/provisioners/chef/plugin.rb
-2.2.6/plugins/guests/tinycore/plugin.rb
-2.2.6/plugins/guests/windows/plugin.rb
-2.2.6/plugins/guests/gentoo/plugin.rb
-2.2.6/plugins/guests/solaris/plugin.rb
-2.2.6/plugins/guests/omnios/plugin.rb
-2.2.6/plugins/guests/alpine/plugin.rb
-2.2.6/plugins/guests/funtoo/plugin.rb
-2.2.6/plugins/guests/openbsd/plugin.rb
-2.2.6/plugins/guests/mint/plugin.rb
-2.2.6/plugins/guests/solaris11/plugin.rb
-2.2.6/plugins/guests/pld/plugin.rb
-2.2.6/plugins/guests/alt/plugin.rb
-2.2.6/plugins/guests/smartos/plugin.rb
-2.2.6/plugins/guests/trisquel/plugin.rb
-2.2.6/plugins/guests/linux/plugin.rb
-2.2.6/plugins/guests/debian/plugin.rb
-2.2.6/plugins/guests/kali/plugin.rb
-2.2.6/plugins/guests/bsd/plugin.rb
-2.2.6/plugins/guests/fedora/plugin.rb
-2.2.6/plugins/guests/ubuntu/plugin.rb
-2.2.6/plugins/guests/darwin/plugin.rb
-2.2.6/plugins/guests/elementary/plugin.rb
-2.2.6/plugins/guests/coreos/plugin.rb
-2.2.6/plugins/guests/suse/plugin.rb
-2.2.6/plugins/guests/slackware/plugin.rb
-2.2.6/plugins/guests/freebsd/plugin.rb
-2.2.6/plugins/guests/amazon/plugin.rb
-2.2.6/plugins/guests/photon/plugin.rb
-2.2.6/plugins/guests/netbsd/plugin.rb
-2.2.6/plugins/guests/arch/plugin.rb
-2.2.6/plugins/guests/nixos/plugin.rb
-2.2.6/plugins/guests/dragonflybsd/plugin.rb
-2.2.6/plugins/guests/atomic/plugin.rb
-2.2.6/plugins/guests/haiku/plugin.rb
-2.2.6/plugins/guests/redhat/plugin.rb
-2.2.6/plugins/guests/esxi/plugin.rb
-2.2.6/plugins/hosts/windows/plugin.rb
-2.2.6/plugins/hosts/gentoo/plugin.rb
-2.2.6/plugins/hosts/alt/plugin.rb
-2.2.6/plugins/hosts/linux/plugin.rb
-2.2.6/plugins/hosts/bsd/plugin.rb
-2.2.6/plugins/hosts/null/plugin.rb
-2.2.6/plugins/hosts/darwin/plugin.rb
-2.2.6/plugins/hosts/suse/plugin.rb
-2.2.6/plugins/hosts/void/plugin.rb
-2.2.6/plugins/hosts/freebsd/plugin.rb
-2.2.6/plugins/hosts/arch/plugin.rb
-2.2.6/plugins/hosts/redhat/plugin.rb
-2.2.6/plugins/kernel_v2/plugin.rb
-2.2.6/plugins/providers/virtualbox/plugin.rb
-2.2.6/plugins/providers/hyperv/plugin.rb
-2.2.6/plugins/providers/docker/plugin.rb
-2.2.6/plugins/communicators/winrm/plugin.rb
-2.2.6/plugins/communicators/winssh/plugin.rb
-2.2.6/plugins/communicators/ssh/plugin.rb
-2.2.6/plugins/pushes/heroku/plugin.rb
-2.2.6/plugins/pushes/atlas/plugin.rb
-2.2.6/plugins/pushes/noop/plugin.rb
-2.2.6/plugins/pushes/local-exec/plugin.rb
-2.2.6/plugins/pushes/ftp/plugin.rb
 INFO manager: Registered plugin: ftp
 INFO manager: Registered plugin: SMB synced folders
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/synced_folders/rsync/plugin.rb
 INFO manager: Registered plugin: RSync synced folders
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/kernel_v1/plugin.rb
 INFO manager: Registered plugin: kernel
 INFO vagrant: `vagrant` invoked: ["share", "--http", "80", "--name", "flirtypee
6b588>)
 INFO environment: Local data path: /home/rakma/trellis/site/trellis/.vagrant
 INFO manager:   - vagrant-share = [installed: 1.1.9 constraint: > 0]
DEBUG bundler: Current generated plugin dependency list: [<Gem::Dependency type=:runtime name="vagrant-bindfs" requirements="= 1.1.4">, <Gem::Dependency type=:runtime name="vagrant-hostmanager" requirements="= 1.8.9">, <Gem::Dependency type
DEBUG bundler: Generating new plugin set instance. Skip gems - []
DEBUG bundler: Activating solution set: ["vagrant-bindfs-1.1.4", "vagrant-hostma
tp-cookie-1.0.3", "rest-client-2.0.2", "vagrant_cloud-2.0.3", "rubyntlm-0.6.2", "nori-2.6.0", "multi_json-1.14.0", "little-plugger-1.1.4", "logging-2.2.2", "htt
1.1.1", "wdm-0.1.1", "rb-kqueue-0.2.5", "net-ssh-5.1.0", "net-scp-1.2.1", "net-sftp-2.1.2", "log4r-1.1.10", "hashicorp-checkpoint-0.1.5", "rb-inotify-0.10.0", "
 INFO manager: Loading plugins...
 INFO manager: Loading plugin `vagrant-bindfs` with default require: `vagrant-bindfs`
 INFO manager: Registered plugin: bindfs
DEBUG manager: Successfully loaded plugin `vagrant-bindfs`.
 INFO manager: Loading plugin `vagrant-hostmanager` with default require: `vagrant-hostmanager`
 INFO manager: Registered plugin: HostManager
DEBUG manager: Successfully loaded plugin `vagrant-hostmanager`.
 INFO manager: Loading plugin `vagrant-share` with default require: `vagrant-share`
 INFO manager: Registered plugin: vagrant-share
DEBUG manager: Successfully loaded plugin `vagrant-share`.
 INFO loader: Set :root = ["#<Pathname:/home/rakma/trellis/site/trellis/Vagrantfile>"]
DEBUG loader: Populating proc cache for #<Pathname:/home/rakma/trellis/flirtypee
agrantfile
 INFO root: Version requirements from Vagrantfile: [">= 2.1.0"]
DEBUG config: Trigger defined for: up
 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "--version"]
 INFO base: VBoxManage path: VBoxManage
DEBUG environment: Initial usable provider list: [[6, :virtualbox]]
DEBUG environment: Priority sorted usable provider list: [:virtualbox]
DEBUG environment: Preferred provider list: []
DEBUG environment: Using provider `virtualbox` detected in configuration and usa
DEBUG meta: Finding driver for VirtualBox version: 6.0.14
 INFO meta: Using VirtualBox driver: VagrantPlugins::ProviderVirtualBox::Driver:
DEBUG environment: Initial usable provider list: [[6, :virtualbox]]
DEBUG environment: Priority sorted usable provider list: [:virtualbox]
DEBUG environment: Preferred provider list: []
DEBUG environment: Using provider `virtualbox` detected in configuration and usable.
 INFO loader: Set "16748600_machine_default" = []
 INFO loader: Loading configuration in order: [:home, :root, "16748600_machine_default"]
DEBUG loader: Loading from: root (cache)
DEBUG loader: Configuration loaded successfully, finalizing and returning
DEBUG client: No authentication token in environment or /home/rakma/.vagrant.d/data/vagrant_login_token
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::AfterTriggerAction:0x0000000001edaf98>
 INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::AfterTriggerAction:0x0000000001edaf98>
 INFO warden: Calling OUT action: #<VagrantPlugins::CloudCommand::AddAuthenticat
n:0x0000000001edb0b0>
 INFO loader: Set :"14307420_bento/ubuntu-18.04_virtualbox" = ["#<Pathname:/home/rakma/.vagrant.d/boxes/bento-VAGRANTSLASH-ubuntu-18.04/201910.20.0/virtualbox/V
bento-VAGRANTSLASH-ubuntu-18.04/201910.20.0/virtualbox/Vagrantfile>
DEBUG loader: Load procs for pathname: /home/rakma/.vagrant.d/boxes/bento-VAGRANTSLASH-ubuntu-18.04/201910.20.0/virtualbox/Vagrantfile
DEBUG loader: Loading from: 14307420_bento/ubuntu-18.04_virtualbox (evaluating)
DEBUG cli: Invoking command class: VagrantPlugins::Share::Command::Share ["--http", "80", "--name", "site.test"]
DEBUG checkpoint_client: no information received from checkpoint
 INFO interface: warn: Vagrant Share now defaults to using the `ngrok` driver.
The `classic` driver has been deprecated.

For more information about the `ngrok` driver, please
refer to the documentation:

Vagrant Share now defaults to using the `ngrok` driver.
The `classic` driver has been deprecated.
  https://www.vagrantup.com/docs/share/

DEBUG share: Getting target VMs for command. Arguments:
DEBUG share:  -- names: []
DEBUG share:  -- options: {:single_target=>true}
DEBUG share: Loading all machines...
 INFO share: Active machine found with name default. Using provider: virtualbox
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::BeforeTriggerAction:0x0000000001616358>
 INFO warden: Calling IN action: #<VagrantPlugins::CloudCommand::AddAuthentication:0x0000000001616308>
DEBUG client: No authentication token in environment or /home/rakma/.vagrant.d/d
ion:0x0000000001616308>
/rakma/.vagrant.d/boxes/bento-VAGRANTSLASH-ubuntu-18.04/201910.20.0/virtualbox/V
tualbox", :home, :root, "16748600_machine_default"]
DEBUG loader: Loading from: 14307420_bento/ubuntu-18.04_virtualbox (cache)
Capture rate:                512kbps
Capture FPS:                 25kbps
Guest:

SharedFolderPathMachineMapping1="/home/rakma/trellis/site/trellis"
VRDEActiveConnection="off"
nt/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/plugin.rb
ess=>#<Proc:0x0000000001aaa068@/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/plugin.rb:37>, :snapshot_list=>#<Proc:0x00000000
SharedFolderPathMachineMapping1="/home/rakma/trellis/site/trellis"
VRDEActiveConnection="off"
vrdeports="5967"
vrdemulticon="off"
vrdereusecon="off"
vrdeport=5967
vrdeports="5967"
vrdevideochannel="off"
vrdeproperty[TCP/Ports]="5967"
vrdeport=5967
vrdeports="5967"
vrdeaddress="127.0.0.1"
vrdereusecon="off"
audio_in="off"
clipboard="disabled"
draganddrop="disabled"
vrde="on"
draganddrop="disabled"
vrde="on"
vrdeport=5967
vrdeports="5967"
vrdeaddress="127.0.0.1"
vrdeauthtype="null"
vrdemulticon="off"
vrdereusecon="off"
vrdevideochannel="off"
vrdeproperty[TCP/Ports]="5967"
vrdeproperty[TCP/Address]="127.0.0.1"
usb="off"
ehci="off"
audio_out="off"
audio_in="off"
vrdeauthtype="null"
vrdevideochannel="off"
vrdeproperty[TCP/Ports]="5967"
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
DEBUG subprocess: stdout: {"ext":".map","lvl":"dbug","msg":"ignoring manifest file with unhandled mimetype","name":"app.css.map","t":"20
2+01:00"}
{"id":"47026e79ad61","lvl":"dbug","msg":"responding with 502","t":"2019-11-22T21:44:19.312906776+01:00"}
DEBUG subprocess: stdout: {"id":"a00fa98dc157","lvl":"dbug","msg":"got request","path":"/favicon.ico","t":"2019-11-22T21:44:19.313199816+01:00","typ":"proxy"}
{"entrysz":374,"lvl":"dbug","msg":"add entry","obj":"storage","sz":2116,"t":"2019-11-22T21:44:19.313303143+01:00"}
{"entrysz":374,"lvl":"dbug","msg":"add entry","obj":"storage","sz":2116,"t":"2019-11-22T21:44:19.313362276+01:00"}
DEBUG subprocess: stdout: {"id":"a00fa98dc157","lvl":"dbug","msg":"got response for request","reqpath":"/favicon.ico","t":"2019-11-22T21:44:19.313960993+01:00","typ":"proxy"}
{"entrysz":468,"lvl":"dbug","msg":"add entry","obj":"storage","sz":2116,"t":"2019-11-22T21:44:19.314095199+01:00"}
DEBUG subprocess: stdout: {"entrysz":2054,"lvl":"dbug","msg":"add entry","obj":"storage","sz":2116,"t":"2019-11-22T21:44:19.314234312+01:00"}
{"err":"\u003cnil\u003e","id":"758b03749bf8","lvl":"dbug","msg":"close","sess":"09f46396709066028036bd4042f6949e","t":"2019-11-22T21:44:19.314359112+01:00","type":"proxy"}
{"err":"\u003cnil\u003e","id":"a00fa98dc157","lvl":"dbug","msg":"close","t":"2019-11-22T21:44:19.314409282+01:00","typ":"proxy"}
{"err":"\u003cnil\u003e","id":"47026e79ad61","lvl":"dbug","msg":"close","t":"2019-11-22T21:44:19.314450684+01:00"}
{"err":"\u003cnil\u003e","id":"758b03749bf8","lvl":"dbug","msg":"close","sess":"09f46396709066028036bd4042f6949e","t":"2019-11-22T21:44:19.314503715+01:00","type":"proxy"}
{"err":"\u003cnil\u003e","id":"a00fa98dc157","lvl":"dbug","msg":"close","t":"2019-11-22T21:44:19.314542942+01:00","typ":"proxy"}
{"err":"\u003cnil\u003e","id":"758b03749bf8","lvl":"dbug","msg":"close","sess":"09f46396709066028036bd4042f6949e","t":"2019-11-22T21:44:19.314593337+01:00","type":"proxy"}
{"err":"\u003cnil\u003e","id":"a00fa98dc157","lvl":"dbug","msg":"close","t":"2019-11-22T21:44:19.314631801+01:00","typ":"proxy"}
DEBUG subprocess: stdout: {"err":"\u003cnil\u003e","id":"758b03749bf8","lvl":"dbug","msg":"close","sess":"09f46396709066028036bd4042f6949e","t":"2019-11-22T21:44:19.314717287+01:00","type":"proxy"}
{"err":"\u003cnil\u003e","id":"a00fa98dc157","lvl":"dbug","msg":"close","t":"2019-11-22T21:44:19.314757781+01:00","typ":"proxy"}
{"err":"EOF","id":"a00fa98dc157","lvl":"dbug","msg":"http.ReadRequest","t":"2019-11-22T21:44:19.314798995+01:00","typ":"proxy"}
{"err":"unexpected EOF","id":"a00fa98dc157","lvl":"dbug","msg":"http.ReadResponse","t":"2019-11-22T21:44:19.314857874+01:00","typ":"proxy"}
^CDEBUG subprocess: stdout: {"lvl":"dbug","msg":"requested stop","obj":"app","t":"2019-11-22T21:44:22.638520277+01:00"}
{"lvl":"info","msg":"received stop request","obj":"app","stopReq":{},"t":"2019-11-22T21:44:22.638624123+01:00"}
{"lvl":"dbug","msg":"waiting for all components to stop","obj":"app","t":"2019-11-22T21:44:22.639020798+01:00"}
{"lvl":"dbug","msg":"waiting for components to stop","obj":"app","remaining":4,"t":"2019-11-22T21:44:22.639106109+01:00"}
{"lvl":"dbug","msg":"waiting for components to stop","obj":"app","remaining":3,"t":"2019-11-22T21:44:22.639154775+01:00"}
{"err":"\u003cnil\u003e","lvl":"info","msg":"session closing","obj":"tunnels.session","t":"2019-11-22T21:44:22.639056715+01:00"}
{"err":"\u003cnil\u003e","lvl":"dbug","msg":"component stopped","name":"signal handler","obj":"app","t":"2019-11-22T21:44:22.639192695+01:00"}
{"err":"\u003cnil\u003e","lvl":"dbug","msg":"component stopped","name":"web","obj":"app","t":"2019-11-22T21:44:22.639205887+01:00"}
{"lvl":"dbug","msg":"waiting for components to stop","obj":"app","remaining":2,"t":"2019-11-22T21:44:22.639237557+01:00"}
{"lvl":"dbug","msg":"waiting for components to stop","obj":"app","remaining":1,"t":"2019-11-22T21:44:22.639499097+01:00"}
{"lvl":"dbug","msg":"all components stopped","obj":"app","t":"2019-11-22T21:44:22.639541092+01:00"}
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31962
DEBUG subprocess: Exit status: 0
 INFO interface: warn: Halting Vagrant share!
 INFO interface: warn: ==> default: Halting Vagrant share!
==> default: Halting Vagrant share!
 INFO environment: Running hook: environment_unload
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: environment_unload #<Vagrant::Action::Builder:0x0000000001a71df8>
➜  trellis

This is not ideal, but maybe helpful?

Would love to get some docs in place if it’s possible to get it working