配置开发环境

vagrant

vagrant可以快速启动一个虚拟机,在虚拟机环境中创建开发环境,与主机隔离。并且开发环境可以快速打包分享给他人。 而且和intellj brains系列的开发套件兼容很好。

安装

Install | Vagrant | HashiCorp Developer

vagrant autocomplete install --bash --zsh

Command-Line Interface | Vagrant | HashiCorp Developer

基本使用

amr64 架构的ubuntu镜像:Vagrant Cloud by HashiCorp

vagrant init bento/ubuntu-20.04-arm64
vagrant up

这个镜像的作者bento是受官方信任的,并且这个镜像支持parallels作为provider。

使用parallels desktop作为虚拟机

GitHub - Parallels/vagrant-parallels: Vagrant Parallels Provider

原理 parallese desktop的virtual machine包含一个uuid,vagrant同该uuid将一个vagrant的配置和指定的vm虚拟机建立联系。 打开一个pvm的虚拟机文件(右键显示包内容),其中包含一个config.vps文件,文本打开文件,内容:

<?xml version="1.0" encoding="UTF-8"?>
<ParallelsVirtualMachine schemaVersion="1.0" dyn_lists="VirtualAppliance 0">
   <AppVersion>18.1.1-53328</AppVersion>
   <ValidRc>2147485060</ValidRc>
   <Identification dyn_lists="">
      <VmUuid>{9c27ae79-fbe5-4c84-9cdc-e1459f642b91}</VmUuid>
      <VmType>0</VmType>

其中 <VmUuid> 就是这个虚拟机的uuid。 vagrant的配置文件

如果想使用一个现存的vm虚拟机作为vagrant的虚拟机,可以通过修改action_provisionid这两个文件的值来实现关联到存在的vm。

podman/docker 等虚拟环境

ubunt

安装c编译环境

ubuntu-ports | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

arm64配置国内源

参考:https://blog.csdn.net/weixin_45902201/article/details/128821714

Last updated

Was this helpful?