-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
123 lines (99 loc) · 3.68 KB
/
Copy pathVagrantfile
File metadata and controls
123 lines (99 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
host = RbConfig::CONFIG['host_os']
# use one quarter of available cores, rounded down to an even number, capped at 2 CPUs (if available)
cores = `getconf _NPROCESSORS_ONLN`.to_i
cpus = [2, [(cores / 4) * 2, 1].max].min
if host =~ /darwin/
mem = [2048, `sysctl -n hw.memsize`.to_i / 1024 / 1024 / 2].min
elsif host =~ /linux/
mem = [2048, `awk '/MemTotal/ {print $2}' /proc/meminfo`.to_i / 1024 / 2].min
else
mem = 1024
end
# to resize primary disk, uncomment the next line
# config.vm.disk :disk, size: "15GB", primary: true
vnc_port = rand(5901..5999).to_s
config.vm.provider "vmware_desktop" do |vmw, override|
vmw.cpus = cpus
vmw.memory = mem
vmw.gui = false
vmw.linked_clone = false
vmw.vmx["RemoteDisplay.vnc.enabled"] = "TRUE"
vmw.vmx["RemoteDisplay.vnc.port"] = vnc_port
vmw.vmx["RemoteDisplay.vnc.password"] = "12345"
end
config.ssh.forward_agent = true
if ARGV.include?("up") || ARGV.include?("reload")
puts "VNC enabled on port: #{vnc_port}"
end
config.vm.define "al2", autostart: false do |al2|
al2.vm.box = "defanator/amazonlinux-2"
al2.vm.hostname = "amazonlinux2"
end
config.vm.define "al2023", autostart: false do |al2023|
al2023.vm.box = "defanator/amazonlinux-2023"
al2023.vm.hostname = "amazonlinux2023"
end
config.vm.define "rocky8", autostart: false do |rocky8|
rocky8.vm.box = "defanator/rockylinux-8"
rocky8.vm.hostname = "rockylinux8"
end
config.vm.define "rocky9", autostart: false do |rocky9|
rocky9.vm.box = "defanator/rockylinux-9"
rocky9.vm.hostname = "rockylinux9"
end
config.vm.define "rocky10", autostart: false do |rocky10|
rocky10.vm.box = "defanator/rockylinux-10"
rocky10.vm.hostname = "rockylinux10"
end
config.vm.define "fc43", autostart: false do |fc43|
fc43.vm.box = "defanator/fedora-cloud-43"
fc43.vm.hostname = "fc43"
end
config.vm.define "debian12", autostart: false do |debian12|
debian12.vm.box = "defanator/debian-12"
debian12.vm.hostname = "debian12"
end
config.vm.define "debian13", autostart: false do |debian13|
debian13.vm.box = "defanator/debian-13"
debian13.vm.hostname = "debian13"
end
config.vm.define "ubuntu2204", autostart: false do |ubuntu2204|
ubuntu2204.vm.box = "defanator/ubuntu-22.04"
ubuntu2204.vm.hostname = "ubuntu2204"
end
config.vm.define "ubuntu2404", autostart: false do |ubuntu2404|
ubuntu2404.vm.box = "defanator/ubuntu-24.04"
ubuntu2404.vm.hostname = "ubuntu2404"
end
config.vm.define "ubuntu2510", autostart: false do |ubuntu2510|
ubuntu2510.vm.box = "defanator/ubuntu-25.10"
ubuntu2510.vm.hostname = "ubuntu2510"
end
config.vm.define "ubuntu2604", autostart: false do |ubuntu2604|
ubuntu2604.vm.box = "defanator/ubuntu-26.04"
ubuntu2604.vm.hostname = "ubuntu2604"
end
config.vm.define "leap16", autostart: false do |leap16|
leap16.vm.box = "defanator/opensuse-leap16"
leap16.vm.hostname = "leap16"
end
config.vm.define "tw", autostart: false do |tw|
tw.vm.box = "defanator/opensuse-tumbleweed"
tw.vm.hostname = "tw"
end
config.vm.define "alpine3", autostart: false do |alpine3|
alpine3.vm.box = "defanator/alpine-3"
alpine3.vm.hostname = "alpine3"
alpine3.ssh.shell = "/bin/sh"
# uncomment the following block to enable serial console on port 11777
#alpine3.vm.provider "vmware_desktop" do |alvmw, override|
# alvmw.vmx["serial0.present"] = "true"
# alvmw.vmx["serial0.yieldOnMsrRead"] = "true"
# alvmw.vmx["serial0.fileType"] = "network"
# alvmw.vmx["serial0.fileName"] = "telnet://:11777"
#end
end
end