Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions vagrant/vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Vagrant.configure('2') do |config|
dev_arg = ENV.fetch('DEV', 'false').to_s
location_arg = ENV.fetch('LOCATION', 'remote').to_s

host_os =
case RUBY_PLATFORM
when /mswin|mingw|cygwin/ then :windows
when /darwin/ then :macos
else :linux
end

config.vm.boot_timeout = 600

# ---------- Hyper-V ----------
Expand Down Expand Up @@ -53,14 +60,22 @@ Vagrant.configure('2') do |config|
vb_vm.vm.box = 'generic/debian12'
vb_vm.vm.hostname = 'WiFiChallengeLab'

# Host-side audio backend
vbox_audio =
case host_os
when :windows then 'dsound'
when :macos then 'coreaudio'
else 'pulse' # Alt: 'alsa', 'none'
end

vb_vm.vm.provider 'virtualbox' do |vb|
vb.memory = 4096
vb.cpus = 4
vb.name = 'WiFiChallenge Lab v2.4.1'
vb.customize ['modifyvm', :id, '--graphicscontroller', 'vmsvga']
vb.check_guest_additions = false
vb.functional_vboxsf = false
vb.customize ['modifyvm', :id, '--audio', 'dsound']
vb.customize ['modifyvm', :id, '--audio', vbox_audio]
vb.customize ['modifyvm', :id, '--audiocontroller', 'hda']
# If you ever need a fallback, swap controller to ac97:
# vb.customize ['modifyvm', :id, '--audiocontroller', 'ac97']
Expand Down Expand Up @@ -213,6 +228,14 @@ Vagrant.configure('2') do |config|
qemu_vm.vm.box = 'generic/debian12'
qemu_vm.vm.hostname = 'WiFiChallengeLab'

# Host-side audio backend
qemu_audio =
case host_os
when :windows then 'dsound,id=snd0'
when :macos then 'coreaudio,id=snd0'
else 'pa,id=snd0' # Alt: alsa,id=snd0
end

qemu_vm.vm.provider 'qemu' do |qemu|
qemu.memory = 4096
qemu.cpus = 4
Expand All @@ -228,7 +251,7 @@ Vagrant.configure('2') do |config|
qemu.uefi = 'C:/Program Files/qemu/share/edk2-x86_64-code.fd'
qemu.gui = true
qemu.extra_qemu_args = [
'-audiodev', 'dsound,id=snd0',
'-audiodev', qemu_audio,
'-device', 'ich9-intel-hda',
'-device', 'hda-duplex,audiodev=snd0'
]
Expand Down Expand Up @@ -273,4 +296,4 @@ Vagrant.configure('2') do |config|
privileged: true,
run: 'once'
end
end
end