まずvagrant boxes
https://app.vagrantup.com/boxes/search
まず、trusty64のvagrant fileを作ります。
mac:myvagrant mac$ mkdir Ubuntu
mac:myvagrant mac$ ls
MyCentOS Ubuntu
mac:myvagrant mac$ cd ubuntu
mac:ubuntu mac$ vagrant init ubuntu/trusty64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
ポートフォワーディング
# config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 80, host: 8080
mac:ubuntu mac$ vagrant reload
==> default: VM not created. Moving on…
mac:ubuntu mac$ vagrant up
mac:ubuntu mac$ vagrant ssh
Welcome to Ubuntu 14.04.6 LTS (GNU/Linux 3.13.0-170-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information as of Sun Oct 27 12:59:04 UTC 2019
System load: 0.49 Processes: 81
Usage of /: 3.6% of 39.34GB Users logged in: 0
Memory usage: 25% IP address for eth0: 10.0.2.15
Swap usage: 0%
Graph this data and manage this system at:
https://landscape.canonical.com/
0 updates can be installed immediately.
0 of these updates are security updates.
New release ‘16.04.6 LTS’ available.
Run ‘do-release-upgrade’ to upgrade to it.
vagrant@vagrant-ubuntu-trusty-64:~$ ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:bb:97:37 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:febb:9737/64 scope link
valid_lft forever preferred_lft forever
vagrant@vagrant-ubuntu-trusty-64:~$ hostname -I
10.0.2.15
あれ
mac:ubuntu mac$ vagrant ssh-config
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /Users/mac/MyVagrant/Ubuntu/.vagrant/machines/default/virtualbox/private_key
IdentitiesOnly yes
LogLevel FATAL
ubuntuの中身を見ると、centosとファイル構成は似ているように見えます。後は使いながら少しずつ覚えていくしかないですね。とりあえず、pythonで開発する際はubuntuベースで使っていこうかと思います^^