安裝Vagrant製作測試環境
安裝
Ubuntu22.04安裝Vagrant
1 | wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg |
安裝VirtualBox
在/etc/apt/sources.list
最下面加上這一行
1 | deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian jammy contrib |
然後下載和註冊public key
1 | wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --dearmor --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg |
顯示fingerprint,應該要為B9F8 D658 297A F3EF C18D 5CDF A2F6 83C5 2980 AECF
1 | gpg --show-keys --with-fingerprint /usr/share/keyrings/oracle-virtualbox-2016.gpg |
最後安裝
1 | sudo apt-get update |
建立一個Ubuntu20.04 box
1 | vagrant init ubuntu/focal64 |
x11 forwarding
共享資料夾
https://developer.hashicorp.com/vagrant/tutorials/getting-started/getting-started-synced-folders
參考:
安裝VirtualBox
https://www.virtualbox.org/wiki/Linux_Downloads
顯示gpg fingerprint
https://superuser.com/a/1747762
安裝Vagrant製作測試環境