Created
December 8, 2018 06:03
-
-
Save kHigasa/22ad9947308bfef2eaf6a1600381bdb4 to your computer and use it in GitHub Desktop.
VagrantでVM上のポートフォワーディングが失敗した(Mac OS)。 ref: https://qiita.com/kHigasa/items/c1016197fe9d3ff7aa65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ vagrant up | |
Bringing machine 'default' up with 'virtualbox' provider... | |
==> default: Importing base box 'ubuntu/trusty64'... | |
==> default: Matching MAC address for NAT networking... | |
==> default: Checking if box 'ubuntu/trusty64' is up to date... | |
==> default: Setting the name of the VM: hogehoge_default_1544239631704_28299 | |
==> default: Clearing any previously set forwarded ports... | |
Vagrant cannot forward the specified ports on this VM, since they | |
would collide with some other application that is already listening | |
on these ports. The forwarded port to 8080 is already in use | |
on the host machine. | |
To fix this, modify your current project's Vagrantfile to use another | |
port. Example, where '1234' would be replaced by a unique host port: | |
config.vm.network :forwarded_port, guest: 80, host: 1234 | |
Sometimes, Vagrant will attempt to auto-correct this for you. In this | |
case, Vagrant was unable to. This is usually because the guest machine | |
is in a state which doesn't allow modifying port forwarding. You could | |
try 'vagrant reload' (equivalent of running a halt followed by an up) | |
so vagrant can attempt to auto-correct this upon booting. Be warned | |
that any unsaved work might be lost. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ sudo lsof -i tcp:8080 | |
Password: | |
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | |
java 466 foo 162u IPv6 0xfc43a646b14c032d 0t0 TCP localhost:http-alt (LISTEN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ kill -9 466 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ sudo lsof -i tcp:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ vagrant up | |
Bringing machine 'default' up with 'virtualbox' provider... | |
==> default: Checking if box 'ubuntu/trusty64' is up to date... | |
==> default: Vagrant has detected a configuration issue which exposes a | |
==> default: vulnerability with the installed version of VirtualBox. The | |
==> default: current guest is configured to use an E1000 NIC type for a | |
==> default: network adapter which is vulnerable in this version of VirtualBox. | |
==> default: Ensure the guest is trusted to use this configuration or update | |
==> default: the NIC type using one of the methods below: | |
==> default: | |
==> default: https://www.vagrantup.com/docs/virtualbox/configuration.html#default-nic-type | |
==> default: https://www.vagrantup.com/docs/virtualbox/networking.html#virtualbox-nic-type | |
==> default: Clearing any previously set network interfaces... | |
==> default: Preparing network interfaces based on configuration... | |
default: Adapter 1: nat | |
default: Adapter 2: hostonly | |
==> default: Forwarding ports... | |
default: 80 (guest) => 8080 (host) (adapter 1) | |
default: 22 (guest) => 2222 (host) (adapter 1) | |
==> default: Running 'pre-boot' VM customizations... | |
==> default: Booting VM... | |
==> default: Waiting for machine to boot. This may take a few minutes... | |
default: SSH address: 127.0.0.1:2222 | |
default: SSH username: vagrant | |
default: SSH auth method: private key | |
default: Warning: Connection reset. Retrying... | |
default: Warning: Remote connection disconnect. Retrying... | |
default: Warning: Connection reset. Retrying... | |
==> default: Machine booted and ready! | |
==> default: Checking for guest additions in VM... | |
default: The guest additions on this VM do not match the installed version of | |
default: VirtualBox! In most cases this is fine, but in rare cases it can | |
default: prevent things such as shared folders from working properly. If you see | |
default: shared folder errors, please make sure the guest additions within the | |
default: virtual machine match the version of VirtualBox you have installed on | |
default: your host and reload your VM. | |
default: | |
default: Guest Additions Version: 4.3.36 | |
default: VirtualBox Version: 5.2 | |
==> default: Setting hostname... | |
==> default: Configuring and enabling network interfaces... | |
==> default: Mounting shared folders... | |
default: /vagrant => /Users/foo/.ghq/github.com/bar/hogehoge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment