Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to support libvirt on Linux #71

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
21 changes: 20 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ Vagrant.configure("2") do |config|
}
end

config.vm.provider :libvirt do |v|
# 4GB RAM
v.memory = 4096
# 2 CPUs
v.cpus = 2
v.nic_model_type = "e1000"
v.input :type => "tablet", :bus => "usb"
end

# timeout of waiting for image to stop running - may be a deprecated setting
config.windows.halt_timeout = 20
# username/password for accessing the image
Expand All @@ -82,13 +91,21 @@ Vagrant.configure("2") do |config|
config.vm.communicator = "winrm"
end

config.ssh.extra_args = ["-o", "HostKeyAlgorithms=ssh-dss", "-o", "PubkeyAcceptedKeyTypes=+ssh-rsa"]

# Synced folders - http://docs.vagrantup.com/v2/synced-folders/
# A synced folder is a fancy term for shared folders - it takes a folder on
# the host and shares it with the guest (vagrant) image. The entire folder
# where the Vagrantfile is located is always shared as `c:\vagrant` (the
# naming of this directory being `vagrant` is just a coincedence).
# Share `packages` directory as `C:\packages`
config.vm.synced_folder "packages", "/packages"
config.vm.synced_folder ".", "/vagrant", disabled: true
unless ENV.has_key?('PRE_PROVISION')
config.vm.synced_folder "packages", "/packages",
rsync__args: ["--verbose", "--archive", "--delete", "-z", "--copy-links", "--protocol=29"]
config.vm.synced_folder ".", "/vagrant",
rsync__args: ["--verbose", "--archive", "--delete", "-z", "--copy-links", "--protocol=29"]
end
#config.vm.synced_folder "temp", "/Users/vagrant/AppData/Local/Temp/chocolatey"
# not recommended for sharing, it may have issues with `vagrant sandbox rollback`
#config.vm.synced_folder "chocolatey", "/ProgramData/chocolatey"
Expand All @@ -110,12 +127,14 @@ Vagrant.configure("2") do |config|
config.vm.provision :shell, :path => "shell/PrepareWindows.ps1"
config.vm.provision :shell, :path => "shell/InstallNet4.ps1"
config.vm.provision :shell, :path => "shell/InstallChocolatey.ps1"
config.vm.provision :shell, :path => "shell/installRsync.ps1"
config.vm.provision :shell, :path => "shell/NotifyGuiAppsOfEnvironmentChanges.ps1"
config.vm.provision :shell, :path => "shell/PostSetup.ps1"
else
config.vm.provision :shell, :path => "shell/PrepareWindows.ps1", :powershell_elevated_interactive => true
config.vm.provision :shell, :path => "shell/InstallNet4.ps1", :powershell_elevated_interactive => true
config.vm.provision :shell, :path => "shell/InstallChocolatey.ps1", :powershell_elevated_interactive => true
config.vm.provision :shell, :path => "shell/installRsync.ps1", :powershell_elevated_interactive => true
config.vm.provision :shell, :path => "shell/NotifyGuiAppsOfEnvironmentChanges.ps1", :powershell_elevated_interactive => true
config.vm.provision :shell, :path => "shell/PostSetup.ps1", :powershell_elevated_interactive => true
end
Expand Down
14 changes: 14 additions & 0 deletions shell/installRsync.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
choco install cygwin -y

& C:\tools\cygwin\cygwinsetup.exe --quiet-mode --packages rsync

New-Item -ItemType Directory -Force C:\vagrant
& C:\tools\cygwin\bin\ln -sT /cygdrive/c/vagrant /vagrant

New-Item -ItemType Directory -Force C:\packages
& C:\tools\cygwin\bin\ln -sT /cygdrive/c/packages /packages

If (!($Env:PATH | Select-String -SimpleMatch "C:\tools\cygwin\bin")) {
$Env:PATH += ";C:\tools\cygwin\bin"
[Environment]::SetEnvironmentVariable("PATH", $Env:PATH + ";C:\tools\cygwin\bin", [EnvironmentVariableTarget]::Machine)
}