当前位置: 首页 > news >正文

网站接入服务商网站app建设图片素材

网站接入服务商,网站app建设图片素材,制作小视频,刚刚发生了一件大事Vagrant在宿主机管理虚拟机镜像Box的详细指南1. 基本概念Vagrant Box是Vagrant的核心组件,它是一个预配置的虚拟机镜像,包含操作系统和基本的软件配置。在宿主机上管理这些Box镜像是Vagrant工作流中的重要环节。2. 常用Box管理命令2.1 添加Box到本地仓库…

Vagrant在宿主机管理虚拟机镜像Box的详细指南

1. 基本概念

Vagrant Box是Vagrant的核心组件,它是一个预配置的虚拟机镜像,包含操作系统和基本的软件配置。在宿主机上管理这些Box镜像是Vagrant工作流中的重要环节。

2. 常用Box管理命令

2.1 添加Box到本地仓库

vagrant box add [box名称] [box文件路径/URL]

示例:

vagrant box add ubuntu/trusty64 https://vagrantcloud.com/ubuntu/boxes/trusty64

2.2 列出已安装的Box

vagrant box list

输出示例:

centos/7          (virtualbox, 1905.1)
ubuntu/bionic64   (virtualbox, 20190618.0.0)

2.3 更新Box

vagrant box update [box名称]

示例:

vagrant box update ubuntu/bionic64

2.4 删除Box

vagrant box remove [box名称]

示例:

vagrant box remove centos/7

3. Box文件存储位置

Vagrant Box默认存储在以下位置:

  • Linux/macOS: ~/.vagrant.d/boxes
  • Windows: C:\Users\<username>\.vagrant.d\boxes

4. 高级管理技巧

4.1 查看Box详细信息

vagrant box outdated
vagrant box prune

4.2 手动管理Box文件

你可以直接操作.vagrant.d/boxes目录,但建议使用Vagrant命令进行管理。

4.3 自定义Box存储路径

通过设置环境变量可以改变Box存储位置:

export VAGRANT_HOME=/path/to/custom/location

5. Box版本管理

Vagrant支持Box的多版本管理,可以通过以下方式指定特定版本:

vagrant box add ubuntu/bionic64 --box-version "20190618.0.0"

6. 创建自定义Box

从现有虚拟机创建自定义Box:

vagrant package --output mybox.box

7. 最佳实践

  1. 定期清理不再使用的Box以节省磁盘空间
  2. 为生产环境使用固定版本的Box以保证一致性
  3. 对自定义Box做好版本标记
  4. 考虑使用私有Box仓库管理内部镜像

通过合理管理Box镜像,可以大大提高Vagrant的工作效率和环境一致性。

实践

添加ubuntu到vagrant

vagrant box add ubuntu "/Users/skywalk/VirtualBox VMs/ubuntu/ubuntu.vdi"

但是没有添加成功,可能是空间不够了....以后有时间再调试。

调试

导入box到本地仓库失败报错

skywalk$ vagrant box add freebsd "/Users/skywalk/VirtualBox VMs/freebsd/freebsd.vbox"

==> box: Box file was not detected as metadata. Adding it directly...

==> box: Adding box 'freebsd' (v0) for provider: (amd64)

    box: Unpacking necessary files from: file:///Users/skywalk/VirtualBox%20VMs/freebsd/freebsd.vbox

The box failed to unpackage properly. Please verify that the box

file you're trying to add is not corrupted and that enough disk space

is available and then try again.

The output from attempting to unpackage (if any):

bsdtar: Error opening archive: Unrecognized archive format

检查Virtualbox版本,发现原来是7.x,现在最新7.1.12,升级到新版本试试

升级后问题照旧

尝试转换vbox存盘文件报错

VBoxManage export <vm-name> -o freebsd.ova

-bash: vm-name: No such file or directory

(base) laiweilideMacBook-Air:freebsd skywalk$ VBoxManage export freebsd.vbox -o freebsd.ova

VBoxManage: error: Failed to create the VirtualBox object!

VBoxManage: error: Code NS_ERROR_FAILURE (0x80004005) - Operation failed (extended info not available)

VBoxManage: error: Most likely, the VirtualBox COM server is not running or failed to start.

弄明白了,应该是vbi文件。另外前面的FreeBSD镜像有问题,换用ubuntu的镜像就好了。因为能添加,所以也就不需要转换vbox了

vagrant box add ubuntu "/Users/skywalk/VirtualBox VMs/ubuntu/ubuntu.vdi"

好吧,又报错了,不过这回看着可能是磁盘空间不够了

==> box: Adding box 'ubuntu' (v0) for provider: (amd64)box: Unpacking necessary files from: file:///Users/skywalk/VirtualBox%20VMs/ubuntu/ubuntu.vdi
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and that enough disk space
is available and then try again.
The output from attempting to unpackage (if any):bsdtar: Error opening archive: Unrecognized archive format

http://www.dtcms.com/a/483206.html

相关文章:

  • 3ds Max从入门到精通:建模、动画与渲染完整实战教程
  • 建设工程项目编号在什么网站查网站建设方案的内容
  • 做网站 多少钱全国优秀施工企业查询
  • 【免费】轻量级服务器centos监控程序+内存+cpu+nginx+适合小型站长使用
  • 青岛模板建站代理模板建站公司
  • 瑞芯微算法环境搭建(1)------编译ffmpeg
  • python策略网站怎么做seo策略工具
  • 建立了公司网站网络营销心得体会
  • 从 C 到 C++:容器适配器 std::stack 与 std::queue 详解
  • 工信部网站备案查询 验证码错误2019年建设银行安徽招聘网站
  • wordpress网站如何搬家wordpress开发入门视频教程
  • 电子商务网站建设与管理思考与练习做暧视频免费网站
  • 建站公司兴田德润网页制作模板 html
  • Spring Boot 3零基础教程,深度理解 Spring Boot 自动配置原理,笔记11
  • PHP MQTT 订阅服务:实时消息接收与数据库存储解决方案
  • 设计网站网站名称冒用公司名做网站
  • Android进阶之路 - 全方位监听视图加载完成
  • PPT-EA:PPT自动生成器
  • 企业微信-智能表格-视图类型
  • 产品网站建设PHP MYSQL网站开发全程实
  • 性能优化-Vue3 + Vite:图片上传/优化到 OSS 并统一使用vite 的 .env 全局配置,js 和 css 共用变量
  • 网站建设项目背景杭州一起做网站
  • 做最好的色书网站半透明wordpress主题源码
  • 17.UE-游戏逆向-查找Aactor(游戏中物品的名字和坐标)
  • 扫黄打非网站建设wordpress上传视频插件
  • 手机网站底部广告代码wordpress版本下载
  • 量子计算与深度学习:新时代材料模拟实战
  • SMTPman,smtp服务器高效邮件发送核心指南
  • UE C++ TMap容器的 创建和遍历
  • 域名与网站名称的关系企业发展历程网站