1. 程式人生 > 其它 >[開發環境]:multipass 在 Windows 平臺的使用和預設 C 盤遷移

[開發環境]:multipass 在 Windows 平臺的使用和預設 C 盤遷移

下載 Multipass

官網:https://multipass.run/docs/privileged-mounts

下載地址:Github Release V1.9.0 Windows版本 加速 下載連結 

安裝過程

更改儲存地址

藉助於 Windows10 軟連線實現

mklink /D "C:\ProgramData\Multipass\data\vault" "E:\multipass-move\data\vault"

mklink /D "C:\ProgramData\Multipass\cache\vault" "E:\multipass-move\cache\vault"

查詢映象

multipass find
Image Aliases Version Description core core16 20200818 Ubuntu Core 16 core18 20211124 Ubuntu Core 18 18.04 bionic 20220513 Ubuntu 18.04
LTS 20.04 focal,lts 20220505 Ubuntu 20.04 LTS 21.10 impish 20220309 Ubuntu 21.10 22.04 jammy 20220506 Ubuntu 22.04 LTS appliance:adguard-home 20200812 Ubuntu AdGuard Home Appliance appliance:mosquitto
20200812 Ubuntu Mosquitto Appliance appliance:nextcloud 20200812 Ubuntu Nextcloud Appliance appliance:openhab 20200812 Ubuntu openHAB Home Appliance appliance:plexmediaserver 20200812 Ubuntu Plex Media Server Appliance anbox-cloud-appliance latest Anbox Cloud Appliance charm-dev latest A development and testing environment for charmers docker latest A Docker environment with Portainer and related tools minikube latest minikube is local Kubernetes

建立映象

multipass lanuch -n clion-gcc bionic

進入映象shell

multipass shss clion-gcc

搭建C/C++ cmake開發環境

# 換源
sudo sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
sudo apt update

# 安裝必備
sudo apt install gcc g++ nano cmake make flex bison wget git unzip --no-install-recommends

cd ~
# 高版本cmake
wget https://github.91chi.fun/https://github.com/Kitware/CMake/releases/download/v3.19.1/cmake-3.19.1.tar.gz --no-check-certificate
tar xzvf cmake-3.19.1.tar.gz
cd cmake-3.19.1
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=install -DCMAKE_USE_OPENSSL=OFF
make -j4
make install

sudo cp install/bin/* /usr/bin/
sudo cp -r install/share/* /usr/share/

cd ~
# 安裝gdb gdb-server
sudo apt install texinfo --no-install-recommends
wget https://mirrors.aliyun.com/gnu/gdb/gdb-10.1.tar.gz
tar xzvf gdb-10.1.tar.gz
cd gdb-10.1
mkdir build
cd build
../configure --prefix=$PWD/install
make -j4
make install
sudo cp install/bin/* /usr/bin/
sudo cp -r install/share/* /usr/share