Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  2. # Use Centos 7 64-bit as our operating system
  3. config.vm.box = "centos/7"
  4.  
  5. # Configurate the virtual machine to use 2GB of RAM and 2 CPU
  6. config.vm.provider :virtualbox do |vb|
  7. vb.name = "vagrant-jenkins"
  8. vb.customize ["modifyvm", :id, "--memory", "2048"]
  9. vb.customize ["modifyvm", :id, "--cpus", "2"]
  10. vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
  11. end
  12.  
  13. config.vm.network :private_network, ip: "192.168.56.8"
  14. ...
  15. end
  16.  
  17. > ➜ toy vagrant up Bringing machine 'default' up with 'virtualbox'
  18. > provider...
  19. > ==> default: Checking if box 'centos/7' is up to date...
  20. > ==> default: A newer version of the box 'centos/7' for provider 'virtualbox' is
  21. > ==> default: available! You currently have version '1804.02'. The latest is version
  22. > ==> default: '1902.01'. Run `vagrant box update` to update.
  23. > ==> default: Clearing any previously set forwarded ports...
  24. > ==> default: Clearing any previously set network interfaces...
  25. > ==> default: Preparing network interfaces based on configuration...
  26. > default: Adapter 1: nat
  27. > default: Adapter 2: hostonly
  28. > ==> default: Forwarding ports...
  29. > default: 22 (guest) => 2222 (host) (adapter 1)
  30. > ==> default: Running 'pre-boot' VM customizations...
  31. > ==> default: Booting VM...
  32. > ==> default: Waiting for machine to boot. This may take a few minutes...
  33. > default: SSH address: 127.0.0.1:2222
  34. > default: SSH username: vagrant
  35. > default: SSH auth method: private key
  36. > ==> default: Machine booted and ready! [default] GuestAdditions 5.2.14 running --- OK.
  37. > ==> default: Checking for guest additions in VM...
  38. > ==> default: Setting hostname...
  39. > ==> default: Configuring and enabling network interfaces...
  40. > default: SSH address: 127.0.0.1:2222
  41. > default: SSH username: vagrant
  42. > default: SSH auth method: private key
  43. > ==> default: Mounting shared folders...
  44.  
  45. ➜ toy ssh -v toy
  46. OpenSSH_7.6p1, LibreSSL 2.6.2
  47. debug1: Reading configuration data /Users/abc/.ssh/config
  48. debug1: /Users/abc/.ssh/config line 11: Applying options for toy
  49. debug1: Reading configuration data /etc/ssh/ssh_config
  50. debug1: /etc/ssh/ssh_config line 48: Applying options for *
  51. debug1: Connecting to 192.168.56.8 port 22.
  52.  
  53. Host toy
  54. Hostname 192.168.56.8
  55. User vagrant
  56. IdentityFile ~/Vagrant/Toy/.vagrant/machines/default/virtualbox/private_key
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement