-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01eca7d
commit b915426
Showing
51 changed files
with
814 additions
and
127 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
for MACHINE_PATH in /srv/kvm/vms/*; do | ||
|
||
if [ -e $MACHINE_PATH/var/pid ]; then | ||
p=$(cat $MACHINE_PATH/var/pid) | ||
if [ -e "/proc/$p" ]; then | ||
vm=$(basename $MACHINE_PATH) | ||
echo "Shutting Down: $vm" | ||
/srv/kvm/OSX-KVM/bin/shutdown-ga $vm & | ||
sleep 2 | ||
fi | ||
|
||
fi | ||
done | ||
|
||
sleep 10 | ||
|
||
for MACHINE_PATH in /srv/kvm/vms/*; do | ||
|
||
|
||
if [ -e $MACHINE_PATH/var/pid ]; then | ||
p=$(cat $MACHINE_PATH/var/pid) | ||
if [ -e "/proc/$p" ]; then | ||
vm=$(basename $MACHINE_PATH) | ||
echo "Shutting Down: $vm" | ||
/srv/kvm/OSX-KVM/bin/shutdown-acpi $vm & | ||
sleep 2 | ||
fi | ||
|
||
fi | ||
|
||
done | ||
sleep 20 | ||
echo "Killing remaining vms" | ||
for MACHINE_PATH in /srv/kvm/vms/*; do | ||
|
||
if [ -e $MACHINE_PATH/var/pid ]; then | ||
p=$(cat $MACHINE_PATH/var/pid) | ||
if [ -e "/proc/$p" ]; then | ||
vm=$(basename $MACHINE_PATH) | ||
echo "Shutting Down: $vm" | ||
/srv/kvm/OSX-KVM/bin/shutdown-hard $vm | ||
fi | ||
|
||
fi | ||
|
||
done |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$(dirname $(readlink -f $0)) | ||
source $SCRIPT_DIR/config-common | ||
|
||
WANT_SEAT=$(echo $1 | cut -d":" -f 2) | ||
WANT_MACHINE=$(echo $1 | cut -d":" -f 1) | ||
|
||
MACHINE=${WANT_MACHINE:-"default"} | ||
SEAT=${WANT_SEAT:-"$MACHINE"} | ||
|
||
MACHINE_PATH="$VM_PREFIX/$MACHINE" | ||
MACHINE_DISKS="$VM_PREFIX/$MACHINE/disks" | ||
|
||
if [ "x$MACHINE" == "x" ]; then | ||
echo "Usage:" | ||
echo "$0 [machine-name]" | ||
exit 3 | ||
fi | ||
|
||
if [ ! -d "$MACHINE_PATH" ]; then | ||
echo "Machine $MACHINE does not exists" | ||
echo "Reason: $MACHINE_PATH does not exist" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -e "$MACHINE_PATH/config" ]; then | ||
echo "Can't load $MACHINE" | ||
echo "Reason: 'config' does not exist in $MACHINE_PATH" | ||
exit 2 | ||
fi | ||
|
||
#LOADING MACHINE CONFIG | ||
source $MACHINE_PATH/config | ||
#==================================== | ||
|
||
mkdir $MACHINE_PATH/cert || true | ||
|
||
CA_KEY=$MACHINE_PATH/cert/ca-key.pem | ||
CA_CERT=$MACHINE_PATH/cert/ca-cert.pem | ||
CA_INFO=$MACHINE_PATH/cert/ca.info | ||
SERVER_KEY=$MACHINE_PATH/cert/server-key.pem | ||
SERVER_CSR=$MACHINE_PATH/cert/server-key.csr | ||
SERVER_CERT=$MACHINE_PATH/cert/server-cert.pem | ||
SERVER_INFO=$MACHINE_PATH/cert/server.info | ||
|
||
|
||
|
||
cd $MACHINE_PATH/cert | ||
cat > $CA_INFO <<EOF | ||
cn = MOSAIK Software VNC | ||
ca | ||
cert_signing_key | ||
EOF | ||
|
||
echo "GENERATING SERVER CERT" | ||
cat > $SERVER_INFO <<EOF | ||
organization = MOSAIK Software VNC | ||
cn = kvm-ch.ad.mosaiksoftware.de | ||
tls_www_server | ||
encryption_key | ||
signing_key | ||
ip_address = "192.168.254.31" | ||
EOF | ||
|
||
echo "Generating PRIVKEY" | ||
|
||
certtool --generate-privkey > $CA_KEY | ||
|
||
echo "Generating CA CERT" | ||
certtool --generate-self-signed \ | ||
--load-privkey $CA_KEY \ | ||
--template $CA_INFO \ | ||
--outfile $CA_CERT | ||
|
||
|
||
echo "Generating SERVER KEY" | ||
certtool --generate-privkey > $SERVER_KEY | ||
|
||
echo "Generating SERVER CERT" | ||
certtool --generate-certificate \ | ||
--load-ca-certificate $CA_CERT \ | ||
--load-ca-privkey $CA_KEY \ | ||
--load-privkey $SERVER_KEY \ | ||
--template $SERVER_INFO \ | ||
--outfile $SERVER_CERT | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[machine] | ||
type = "pc" | ||
accel = "kvm" | ||
|
||
[device "pcie.8"] # VFIO GPU | ||
# driver = "pcie-root-port" | ||
driver = "ioh3420" | ||
bus = "pci.0" | ||
addr = "1c" | ||
port = "8" | ||
chassis = "8" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[device] | ||
driver = "virtio-rng-pci" | ||
rng = "rng0" | ||
addr = "0x3" | ||
|
||
[object "rng0"] | ||
qom-type = "rng-random" | ||
filename = "/dev/urandom" | ||
|
Oops, something went wrong.