virtualbox+vagrant学习-3-Vagrant Share-4-Vagrant Connect
Vagrant Connect
vagrant可以共享到vagrant环境的任何或每个端口,而不仅仅是SSH和HTTP。“vagrant connect”命令为连接人员提供一个静态IP,他们可以使用该IP与共享的vagrant环境通信。发送到此IP的任何TCP流量都被发送到共享的vagrant环境。
1.Usage
即调用vagrant share --full命令
这将自动为远程连接共享尽可能多的端口。更多信息请查看 the Vagrant share security page页面。
注意在调用vagrant share --full命令末尾的共享名字,并将其提供给希望连接到你的机器的人。他们只需要简单地调用vagrant connect NAME命令即可(和上一篇ssh的连接方法一样)。这将给他们一个静态IP,他们可以使用它来访问你的vagrant环境。
userdeMacBook-Pro:~ user$ vagrant share --full --http
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: https://www.vagrantup.com/docs/share/ ==> default: Detecting network information for machine...
default: Local machine address: 127.0.0.1
default:
default: Note: With the local address (127.0.0.1), Vagrant Share can only
default: share any ports you have forwarded. Assign an IP or address to your
default: machine to expose all TCP ports. Consult the documentation
default: for your provider ('virtualbox') for more information.
default:
default: Local HTTP port:
default: Local HTTPS port: disabled
default: Port:
==> default: Creating Vagrant Share session...
share: Importing base box 'hashicorp/vagrant-share'...
share: Matching MAC address for NAT networking...
share: Setting the name of the VM: share-fe65ef45-f050-4cc9-98ba-bd19ec32d8e0
share: Fixed port collision for => . Now on port .
share: Vagrant has detected a configuration issue which exposes a
share: vulnerability with the installed version of VirtualBox. The
share: current guest is configured to use an E1000 NIC type for a
share: network adapter which is vulnerable in this version of VirtualBox.
share: Ensure the guest is trusted to use this configuration or update
share: the NIC type using one of the methods below:
share:
share: https://www.vagrantup.com/docs/virtualbox/configuration.html#default-nic-type
share: https://www.vagrantup.com/docs/virtualbox/networking.html#virtualbox-nic-type
share: Clearing any previously set network interfaces...
share: Preparing network interfaces based on configuration...
share: Adapter : nat
share: Forwarding ports...
share: (guest) => (host) (adapter )
share: (guest) => (host) (adapter )
share: Running 'pre-boot' VM customizations...
share: Booting VM...
share: Waiting for machine to boot. This may take a few minutes...
share: SSH address: 127.0.0.1:
share: SSH username: tc
share: SSH auth method: password
share:
share: Inserting generated public key within guest...
share: Removing insecure key from the guest if it's present...
share: Key inserted! Disconnecting and reconnecting using new SSH key...
share: Machine booted and ready!
==> share:
==> share: Your Vagrant Share is running! Name: budget_hello:agenda_design
==> share:
==> share: You're sharing full access to your Vagrant machine. This means that
==> share: another user can have access to your Vagrant machine by running:
==> share:
==> share: vagrant connect budget_hello:agenda_design
==> share:
==> share: HTTP URL: http://5fd8f0d7.ngrok.io
==> share:
==> share:
==> share: Your Vagrant Share is running! Name: budget_hello:agenda_design
==> share:
==> share: You're sharing full access to your Vagrant machine. This means that
==> share: another user can have access to your Vagrant machine by running:
==> share:
==> share: vagrant connect budget_hello:agenda_design
==> share:
==> share: HTTP URL: http://5fd8f0d7.ngrok.io
==> share:
相应虚拟机也已经打开:

2.How does it work?
vagrant connect的运行是通过做vagrant最擅长的事情:管理虚拟机来实现的。vagrant connect使用VirtualBox或VMware(更多的提供者支持即将到来)创建了一个只占用20 MB内存的小型虚拟机。
然后,发送到这个小型虚拟机的任何流量都被代理到共享的vagrant环境,就好像它被定向到这个环境一样。
$vagrant connect budget_hello:agenda_design
3.Beware: Vagrant Insecure Key
如果你正在使用的vagrant环境或box是受到vagrant不安全密钥对(大多数公共box都是)的保护,那么连接到SSH的任何人都可以轻松地使用SSH。
虽然你希望与你信任的人共享,但在某些环境中,你可能与类或conference共享,并且不希望它们能够SSH进入。
在这种情况下,我们建议从vagrant计算机中更改或删除不安全的密钥。
最后,我们要注意,我们正在努力使之在使用vagrant share时,除非显式允许,否则vagrant私钥将被主动拒绝。但是,这个特性还没有完成。
virtualbox+vagrant学习-3-Vagrant Share-4-Vagrant Connect的更多相关文章
- virtualbox+vagrant学习-2(command cli)-26-vagrant share命令
Share share命令初始化了一个vagrant share会话,允许你与世界上任何一个人共享vagrant环境,允许在几乎任何网络环境中直接在vagrant环境中进行协作. 你可以在本博客的vi ...
- virtualbox+vagrant学习-1-环境安装及vagrantfile的简单配置-Mac系统
在学习docker-machine时,发现需要使用到虚拟化平台,所以选择了使用virtualBox. 然后后面发现需要使用vagrant来在mac系统中作为虚拟机管理软件,所以下面将会简述我自己学习使 ...
- virtualbox+vagrant学习-3-Vagrant Share-2-HTTP Sharing
HTTP Sharing Vagrant Share可以创建一个可公开访问的URL端点来访问在Vagrant环境中运行的HTTP服务器.这被称为“HTTP共享”,在使用Vagrant Share时默认 ...
- virtualbox+vagrant学习-3-Vagrant Share-3-SSH Sharing
SSH Sharing vagrant share通过向vagrant share提供--SSH标志,使远程SSH访问vagrant环境变得非常容易. 如果你想让同事访问你的SSH,以便对ops问题进 ...
- virtualbox+vagrant学习-3-Vagrant Share-1-简介
Vagrant Share 通过 ngrok 内网穿透功能实现让全世界人可以访问虚拟机的服务 Vagrant Share允许你与世界上的任何人共享您的Vagrant环境,几乎支持你在任何网络环境中使用 ...
- virtualbox+vagrant学习-2(command cli)-7-vagrant login命令
Login ⚠️该命令已经弃用了,别名为vagrant cloud auth login.看本博客的 格式: vagrant cloud auth login [options] 登录命令用于使用Ha ...
- virtualbox+vagrant学习-2(command cli)-24-Aliases别名
Aliases 别名的部分灵感来自Git自身的别名功能,它允许你创建自己的定制vagrant命令,从而使你的vagrant体验更简单.更容易.更熟悉. 别名可以在VAGRANT_HOME/ alias ...
- virtualbox+vagrant学习-5-Boxes-1-简介
Boxes boxes是vagrant环境的包格式.在vagrant支持的任何平台上,任何人都可以使用一个box来创建一个相同的工作环境.vagrant box实用程序提供了管理boxes的所有功能. ...
- virtualbox+vagrant学习-2(command cli)-1-vagrant box命令
vagrant box 这是用于管理(添加.删除等)boxes的命令. box 是一个打包好的操作系统,是一个后缀名为 .box 的文件,其实是一个压缩包,里面包含了 Vagrant 的配置信息和 V ...
随机推荐
- 深入理解JVM之JVM内存区域与内存分配
深入理解JVM之JVM内存区域与内存分配 在学习jvm的内存分配的时候,看到的这篇博客,该博客对jvm的内存分配总结的很好,同时也利用jvm的内存模型解释了java程序中有关参数传递的问题. 博客出处 ...
- mac,macbook 连接蓝牙耳机播放音乐断断续续
个人的情况是, mac本连的网线,用的无线鼠标, 屋里80多号人都在用笔记本,应该也有好多开着无线的东西 解决方法: mac 或macbook 连接蓝牙耳机播放音乐断断续续的原因, 在网上找了好多方法 ...
- js-权威指南学习笔记13
第十三章 Web浏览器中的JavaScript 1.在客户端JS中,window对象也是全局对象. 2.window对象中其中一个最重要的属性是document,它引用Document对象. 3.JS ...
- request获取当前用户
1.request.getRemoteUser();//获取当前缓存的用户,比如Spring Security做权限控制后就会将用户登录名缓存到这里 request.getRemoteAddr();/ ...
- JS获取对象“属性和方法”的方法
平时在写的代码过程中,经常会遇到对对象Object的数据处理.而在对对象的数据处理中,操作最频繁的是“数据引用”.“值的修改”.“获取关键字(属性)”.平时最烦的也是“获取关键字”,经常忘记怎么去获取 ...
- JAVA 分布式 - 分布式介绍
什么是分布式系统? 要理解分布式系统,主要需要明白一下2个方面: 1.分布式系统一定是由多个节点组成的系统. 其中,节点指的是计算机服务器,而且这些节点一般不是孤立的,而是互通的. 2.这些连通的节点 ...
- web.xml里welcome-file欢迎页面配置及web.xml简介
web项目欢迎页面的配置 <welcome-file-list> <welcome-file>/WEB-INF/index.html</welcome-file> ...
- error MSB3552: Resource file "**/*.resx" cannot be found. [/ConsoleApp1.csproj]
问题场景: 练习在docker下操作netcore,镜像为centos7,安装完netcore sdk 2.2后,执行操作: dotnet new consoledotnet run 出现报错: /u ...
- 如何监视和更新 Azure 中的 Linux 虚拟机
为确保 Azure 中的虚拟机 (VM) 正常运行,可以查看启动诊断.性能指标,并管理程序包更新. 本教程介绍如何执行下列操作: 在 VM 上启用启动诊断 查看启动诊断 在 VM 上启用诊断扩展 基于 ...
- 转: 根据屏幕分辨率,浏览器调用不同css
<link type="text/csss" href="" rel="stylesheet"/> <link type= ...