adds demo using vagrant

This commit is contained in:
Tomasz 2021-09-07 21:13:24 +02:00
parent 96f8a66440
commit cd9d247be9
4 changed files with 48 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/vagrant/.vagrant/
/vagrant/backup/

View file

@ -53,6 +53,19 @@ bash installer.sh --machine MY_MACHINE
- tinker
- khadas-vim3
## Demo
Vagrant can create virtual mashine with the Home Assistant Supervisor. It can be used to play around with Home Assistant.
All files are kept inside virtual machine besides backup directory. Backup directory is mapped to `vagrant/backup`.
It can be used to restore Home Assistant after destroying virtual machine.
Installation can be accessed by http://192.168.50.4:8123
```bash
cd vagrant
vagrant up
```
## Troubleshooting
If somethings going wrong, use `journalctl -f` to get your system logs. If you are not familiar with Linux and how you can fix issues, we recommend to use our Home Assistant OS.

24
vagrant/Vagrantfile vendored Normal file
View file

@ -0,0 +1,24 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "debian/bullseye64"
config.vm.synced_folder "backup", "/usr/share/hassio/backup/", owner: "root", group: "root", create: true
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = "2"
#uncomment those if you need to redirect USB devices
# vb.customize ["modifyvm", :id, "--usb", "on"]
# vb.customize ["modifyvm", :id, "--usbehci", "on"]
#to find vendorid and producctid please use 'VBoxManage list usbhost'
# vb.customize ["usbfilter", "add", "0",
# "--target", :id,
# "--name", "Zigbee",
# "--vendorid", "0x1a86",
# "--productid", "0x7523"]
end
config.vm.provision :shell, path: "bootstrap.sh"
config.vm.network "private_network", ip: "192.168.50.4"
end

9
vagrant/bootstrap.sh Normal file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
apt-get update
apt-get install -y curl network-manager apparmor docker.io jq
curl -sLo installer.sh https://raw.githubusercontent.com/home-assistant/supervised-installer/master/installer.sh
sed -i "s/read answer.*/answer=n/g" installer.sh
sed -i "/sleep 10/d" installer.sh
sed -i "s/IP_ADDRESS=.*/IP_ADDRESS=192.168.50.4/g" installer.sh
sudo bash installer.sh