All Projects → rgl → ubuntu-vagrant

rgl / ubuntu-vagrant

Licence: other
Ubuntu Linux Vagrant Base Box (https://app.vagrantup.com/rgl)

Programming Languages

HCL
1544 projects
shell
77523 projects
Makefile
30231 projects
powershell
5483 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to ubuntu-vagrant

ansible-role-cardano-node
Ansible role for the provisioning of Shelly Cardano binaries from source.
Stars: ✭ 20 (-20%)
Mutual labels:  vagrant, packer
docker-hands-on-guide
Hands on guide for docker, k8s cluster lightweight virtualization.
Stars: ✭ 25 (+0%)
Mutual labels:  vagrant, packer
windows-docker-desktop-box
Vagrant box to test Docker Desktop with Linux/Windows containers
Stars: ✭ 17 (-32%)
Mutual labels:  vagrant, packer
Detectionlab
Automate the creation of a lab environment complete with security tooling and logging best practices
Stars: ✭ 3,237 (+12848%)
Mutual labels:  vagrant, packer
packer-FreeBSD
Build a FreeBSD VM for Vagrant using packer
Stars: ✭ 23 (-8%)
Mutual labels:  vagrant, packer
packer-centos
Create CentOS images for different hypervisors with Packer
Stars: ✭ 18 (-28%)
Mutual labels:  vagrant, packer
dockpack
This project uses ansible, packer and vagrant to create an agile lab.
Stars: ✭ 13 (-48%)
Mutual labels:  vagrant, packer
Packer Build
Packer Automated VM Image and Vagrant Box Builds
Stars: ✭ 199 (+696%)
Mutual labels:  vagrant, packer
packer-kali linux
This is a repository that will be used to help create a process of a new kali vagrant box for hashicorp each week.
Stars: ✭ 36 (+44%)
Mutual labels:  vagrant, packer
packer-vagrant-builder
Build Solaris,CentOS or Ubuntu Vagrant box with puppet rpm's
Stars: ✭ 49 (+96%)
Mutual labels:  vagrant, packer
Packer
Packer helpers and templates for Docker, IIS, SQL Server and Visual Studio on Windows and Ubuntu
Stars: ✭ 242 (+868%)
Mutual labels:  vagrant, packer
arch-ansible
An Ansible playbook to install Arch Linux
Stars: ✭ 33 (+32%)
Mutual labels:  vagrant, packer
Packer Centos 7
This build has been moved - see README.md
Stars: ✭ 223 (+792%)
Mutual labels:  vagrant, packer
django-angular2-fullstack-devops
All-in-one django/angular2 seed with cli interface for multi-environment devops on aws using ansible/packer/terraform
Stars: ✭ 54 (+116%)
Mutual labels:  vagrant, packer
Packer Templates
Scripts and Templates used for generating Vagrant images
Stars: ✭ 219 (+776%)
Mutual labels:  vagrant, packer
proxmox-ve
Proxmox VE Vagrant Base Box
Stars: ✭ 70 (+180%)
Mutual labels:  vagrant, packer
Windows Vagrant
Windows 2012R2/10/2016/2019 Base Vagrant Box (https://app.vagrantup.com/rgl)
Stars: ✭ 169 (+576%)
Mutual labels:  vagrant, packer
Nixbox
NixOS Vagrant boxes [[email protected]]
Stars: ✭ 189 (+656%)
Mutual labels:  vagrant, packer
packer-windows
Windows Templates for Packer: Windows 11, Windows 10, Windows Server 2022, 2019, 2016, also with Docker
Stars: ✭ 1,116 (+4364%)
Mutual labels:  vagrant, packer
opnsense-starterkit
Try opnsense, build opnsense images or start development
Stars: ✭ 18 (-28%)
Mutual labels:  vagrant, packer

This builds an up-to-date Vagrant Ubuntu Base Box as described at the From Iso To Vagrant Box article.

Currently this targets Ubuntu 20.04 (Focal Fossa).

Other Ubuntu versions might be available in a separate branch.

Usage

Install Packer 1.7+ and Vagrant 2.2.14+.

Ubuntu Host

On a Ubuntu host, install the dependencies by running the file at:

https://github.com/rgl/xfce-desktop-vagrant/blob/master/provision-virtualization-tools.sh

And you should also install and configure the NFS server. E.g.:

# install the nfs server.
sudo apt-get install -y nfs-kernel-server

# enable password-less configuration of the nfs server exports.
sudo bash -c 'cat >/etc/sudoers.d/vagrant-synced-folders' <<'EOF'
Cmnd_Alias VAGRANT_EXPORTS_CHOWN = /bin/chown 0\:0 /tmp/*
Cmnd_Alias VAGRANT_EXPORTS_MV = /bin/mv -f /tmp/* /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
%sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_CHOWN, VAGRANT_EXPORTS_MV, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY
EOF

For more information see the Vagrant NFS documentation.

Windows Host

On a Windows host, install Chocolatey, then execute the following PowerShell commands in a Administrator PowerShell window:

# NB if you want to use Hyper-V see the Hyper-V section in this document
#    and do not install virtualbox at all.
choco install -y virtualbox --params "/NoDesktopShortcut /ExtensionPack"
choco install -y packer vagrant jq msys2

Then open a bash shell by starting C:\tools\msys64\mingw64.exe and install the remaining dependencies:

pacman --noconfirm -Sy make zip unzip tar dos2unix netcat procps xorriso mingw-w64-x86_64-libcdio openssh
for n in /*.ini; do
    sed -i -E 's,^#?(MSYS2_PATH_TYPE)=.+,\1=inherit,g' $n
done
exit

NB The commands described in this README should be executed in a mingw64 bash shell.

qemu-kvm usage

Install qemu-kvm:

apt-get install -y qemu-kvm
apt-get install -y sysfsutils
systool -m kvm_intel -v

Type make build-libvirt and follow the instructions.

Try the example guest:

cd example
apt-get install -y virt-manager libvirt-dev
vagrant plugin install vagrant-libvirt
vagrant up --provider=libvirt --no-destroy-on-error --no-tty
vagrant ssh
exit
vagrant destroy -f

VirtualBox usage

Install VirtuaBox.

Type make build-virtualbox and follow the instructions.

Try the example guest:

cd example
vagrant up --provider=virtualbox --no-destroy-on-error --no-tty
vagrant ssh
exit
vagrant destroy -f

Hyper-V usage

Install Hyper-V and also install the Windows Sandbox feature (for some reason, installing this makes DHCP work properly in the vEthernet Default Switch).

Make sure your user is in the Hyper-V Administrators group or you run with Administrative privileges.

Make sure your Virtual Switch (its vEthernet network adapter) is excluded from the Windows Firewall protected network connections by executing the following commands in a bash shell with Administrative privileges:

PowerShell -Command 'Get-NetFirewallProfile | Select-Object -Property Name,DisabledInterfaceAliases'
PowerShell -Command 'Set-NetFirewallProfile -DisabledInterfaceAliases (Get-NetAdapter -name "vEthernet*" | Where-Object {$_.ifIndex}).InterfaceAlias'

Create the base image in a bash shell with Administrative privileges:

cat >secrets.sh <<EOF
# set this value when you need to set the VM Switch Name.
export HYPERV_SWITCH_NAME='Default Switch'
# set this value when you need to set the VM VLAN ID.
export HYPERV_VLAN_ID=''
# set the credentials that the guest will use
# to connect to this host smb share.
# NB you should create a new local user named _vagrant_share
#    and use that one here instead of your user credentials.
# NB it would be nice for this user to have its credentials
#    automatically rotated, if you implement that feature,
#    let me known!
export VAGRANT_SMB_USERNAME='_vagrant_share'
export VAGRANT_SMB_PASSWORD=''
# remove the virtual switch from the windows firewall.
# NB execute if the VM fails to obtain an IP address from DHCP.
PowerShell -Command 'Set-NetFirewallProfile -DisabledInterfaceAliases (Get-NetAdapter -name "vEthernet*" | Where-Object {$_.ifIndex}).InterfaceAlias'
EOF
source secrets.sh
make build-hyperv

Try the example guest:

NB You will need Administrative privileges to create the SMB share.

cd example
# grant $VAGRANT_SMB_USERNAME full permissions to the
# current directory.
# NB you must first install the Carbon PowerShell module
#    with choco install -y carbon.
# TODO set VM screen resolution.
PowerShell -Command '&"$env:ChocolateyInstall/lib/Carbon/Carbon/Import-Carbon.ps1"; Grant-CPermission . $env:VAGRANT_SMB_USERNAME FullControl'
vagrant up --provider=hyperv --no-destroy-on-error --no-tty
vagrant ssh
exit
vagrant destroy -f

VMware vSphere usage

Download govc and place it inside your /usr/local/bin directory.

Set your VMware vSphere details and test the connection:

sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev
vagrant plugin install vagrant-vsphere
cat >secrets.sh <<'EOF'
export GOVC_INSECURE='1'
export GOVC_HOST='vsphere.local'
export GOVC_URL="https://$GOVC_HOST/sdk"
export GOVC_USERNAME='[email protected]'
export GOVC_PASSWORD='password'
export GOVC_DATACENTER='Datacenter'
export GOVC_CLUSTER='Cluster'
export GOVC_DATASTORE='Datastore'
export VSPHERE_OS_ISO="[$GOVC_DATASTORE] iso/ubuntu-20.04-amd64-netboot-mini.iso"
export VSPHERE_ESXI_HOST='esxi.local'
export VSPHERE_TEMPLATE_FOLDER='test/templates'
export VSPHERE_TEMPLATE_NAME="$VSPHERE_TEMPLATE_FOLDER/ubuntu-20.04-amd64-vsphere"
export VSPHERE_VM_FOLDER='test'
export VSPHERE_VM_NAME='ubuntu-vagrant-example'
export VSPHERE_VLAN='packer'
export VSPHERE_IP_WAIT_ADDRESS='0.0.0.0/0'
# set the credentials that the guest will use
# to connect to this host smb share.
# NB you should create a new local user named _vagrant_share
#    and use that one here instead of your user credentials.
# NB it would be nice for this user to have its credentials
#    automatically rotated, if you implement that feature,
#    let me known!
export VAGRANT_SMB_USERNAME='_vagrant_share'
export VAGRANT_SMB_PASSWORD=''
EOF
source secrets.sh
# see https://github.com/vmware/govmomi/blob/master/govc/USAGE.md
govc version
govc about
govc datacenter.info # list datacenters
govc find # find all managed objects

Download the Ubuntu ISO (you can find the full iso URL in the ubuntu.pkr.hcl file) and place it inside the datastore as defined by the iso_paths property that is inside the packer template file.

See the example Vagrantfile to see how you could use a cloud-init configuration to configure the VM.

Type make build-vsphere and follow the instructions.

Try the example guest:

source secrets.sh
cd example
vagrant up --provider=vsphere --no-destroy-on-error --no-tty
vagrant ssh
exit
vagrant destroy -f
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].