v5tech
v5tech
``` ruby Vagrant.configure("2") do |config| config.vm.define :u1 do |u1| u1.vm.provider "virtualbox" do |v| v.customize ["modifyvm", :id, "--name", "u1", "--memory", "1024"] end u1.vm.box = "ubuntu/trusty64" u1.vm.hostname = "u1" u1.vm.network :public_network, ip:...
http://stackoverflow.com/questions/34176041/vagrant-with-virtualbox-on-windows10-rsync-could-not-be-found-on-your-path ``` ruby Vagrant.configure("2") do |config| config.vm.box = "CentOS/7" config.vm.hostname = "c" config.vm.network :public_network, ip: "192.168.99.138" config.vm.provider "virtualbox" do |v| v.memory = "2048" v.name = "c" end end ``` 若报`"rsync"...
# windows下centos7镜像共享目录报错解决方法 * rsync方式(默认方式) 修改`C:\Users\Administrator\.vagrant.d\boxes\centos-VAGRANTSLASH-7\0\virtualbox\Vagrantfile`文件中的`config.vm.synced_folder`为`rsync` 如下所示 ``` config.vm.synced_folder ".", "/vagrant", type: "rsync" ``` 下载 https://itefix.net/dl/cwRsync_5.5.0_x86_Free.zip 文件,解压后将`rsync.exe`添加到`Path`环境变量中 ``` vagrant reload ``` * virtualbox方式共享目录 修改`C:\Users\Administrator\.vagrant.d\boxes\centos-VAGRANTSLASH-7\0\virtualbox\Vagrantfile`文件中的`config.vm.synced_folder`为`virtualbox` 如下所示 ``` config.vm.synced_folder ".", "/vagrant", type: "virtualbox"...
# 使用metadata.json方式添加本地box 使用该方式添加的box将带有版本信息 其`metadata.json`文件内容如下 ``` { "name": "centos/7", "description": "This box contains CentOS 7 64-bit.", "versions": [ { "version": "1705.01", "providers": [ { "name": "virtualbox", "url": "centos7.box" } ] }...
# Windows 10下正常运行Vagrant的版本如下所示 ``` Vagrant 1.8.7 VirtualBox 5.1.10 ``` ## 切勿升级,切勿升级,切勿升级
# CentOS 7单机自定义Vagrantfile ```ruby Vagrant.configure("2") do |config| config.vm.define "centos7" do |node| node.vm.box = "centos/7" node.vm.box_version = "1705.01" node.vm.box_check_update = false node.vm.provision "shell", inline: "echo This box contains CentOS 7 64-bit."...
# 离线方式添加 Box 编写 metadata.json ```json { "name": "centos/7", "versions": [{ "version": "1710.01", "providers": [{ "name": "virtualbox", "url": "file:///virtualbox.box" }] }] } ``` 添加 Box ```bash vagrant box add metadata.json...
### Vagrant设置账号密码登录 在虚拟机 vagrantfile 的目录位置 打开控制台,输入vagrant ssh-config ``` ❯ vagrant ssh-config Host centos7 HostName 127.0.0.1 User vagrant Port 2222 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile /Users/amz/develop/Vagrant/centos/.vagrant/machines/centos7/virtualbox/private_key IdentitiesOnly yes LogLevel...
# Vagrant 管理 ```bash # 全局管理 vagrant global-status vagrant global-status --prune vagrant destroy vagrant halt vagrant reload .. vagrant up .. ``` # Vagrant 插件 * vagrant-hostmanager 实现多台虚拟机之间直接通过名称访问,原理为更改 host文件 ```bash...
http://www.socks163.com ``` python # -*- coding: utf-8 -*- import requests import lxml.html import re import codecs import sys import logging reload(sys) sys.setdefaultencoding('utf-8') # 设置日志级别 if sys.version_info[:3] < (2, 7, 9):...