Advertisement
independentt

XEN autoconfigure + install Windows Server 2019 Trial 180Day

Mar 18th, 2020
14,099
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.19 KB | None | 0 0
  1. #!/usr/bin/bash
  2. echo 'XEN Hypervisor 4.11 AMD64 Autoconfig & Installer v1.2 by https://github.com/independentcod';
  3. echo 'Please enter your password to continue...';
  4. sudo clear;
  5. read -p 'Do you want to install the xen dependencies and other software from apt? [ Y ]' ready;
  6. case $ready in
  7. Y) sudo xterm -e sudo apt update && sudo xterm -e sudo apt install xen-hypervisor-4.11-amd64 xen-hypervisor-common xen-tools gparted vinagre -y &
  8. esac
  9. read -p 'Do you want to launch the download of Windows-server-2019-evaluation.iso from Microsoft website? [ Y ]' dl;
  10. case $dl in
  11. Y) xterm -e wget -O windows-server-2019-evaluation.iso https://is.gd/winserver2019 &
  12. esac
  13. read -p 'Do you want to edit your configurations? [ Y ]' edit;
  14. case $edit in
  15. Y) wget -O xen.cfg https://pastebin.com/raw/uDsnswQg;
  16. read -p 'Give a name to your Virtual Machine: [eg: WindowsServer]' name && sed -i~ -e "s|WindowsServer|server => \'${name}\',|g" xen.cfg;
  17. esac
  18. read -p 'Do you know in which partition you want to install your VM [ N ]' dl;
  19. case $dl in
  20. N) echo 'First you have to make sure you have enough space to make a new volume group' && sudo gparted;;
  21. esac
  22. echo 'Now you must tell this installer where the volume group will be installed';
  23. read -p 'Where the volume group should be located? [eg. /dev/sda3]' loc;
  24. sed -i~ -e "s|/dev/sda6|server => \'${loc}\',|g" xen.cfg && sudo vgcreate ${name} ${loc};
  25. read -p 'What size the logical volume should have? [Recommend: 20G minimum]' lv;
  26. sudo lvcreate -L ${lv} ${name};
  27. read -p 'How much RAM, in MB, should your VM use? [Recommend: 2048]' maxmem;
  28. sed -i~ -e "s|2048|server => \'${maxmem}\',|g" xen.cfg;
  29. read -p 'Time to reboot your machine are you ready? [Make sure the downloads are finished [ Y ]]' ready;
  30. case $ready in
  31. Y) echo 'Once you are booted make sure you sre booting with xen and rerun this script for the second part of the setup. Rebooting in 15 seconds...' && sleep 15 && sudo reboot now;;
  32. esac
  33. read -p 'ARE YOU READY FOR THE 2ND PART OF THE SCRIPT? [ Y ]' ready;
  34. case $ready in
  35. Y) echo 'To connect to the virtual machine the protocol is SPICE and address is 127.0.0.1:1' && vinagre sudo brctl addbr xenbr0 && sudo ifconfig xenbr0 up && sudo xl create xen.cfg;;
  36. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement