Difference between revisions of "Create WeBWorK Virtual Machine (.OVA) File"
(49 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
Note that the resulting .ova image can be used to create a virtual machine |
Note that the resulting .ova image can be used to create a virtual machine |
||
− | Build the server on VMWare Workstation |
+ | Build the server on VMWare Workstation Player |
− | # |
+ | # 30 GBk disk (single file) |
− | # |
+ | # 4 GB memory |
− | # |
+ | # 2 cpu |
− | The above resources are |
+ | The above resources are small. |
# Download the ubuntu live CD (server version) |
# Download the ubuntu live CD (server version) |
||
− | |||
# Install following the standard directions with the following options |
# Install following the standard directions with the following options |
||
− | |||
# Don't partition disks separately |
# Don't partition disks separately |
||
# User name: wwadmin |
# User name: wwadmin |
||
Line 22: | Line 20: | ||
# Computer name: wwserver |
# Computer name: wwserver |
||
− | ===Do not install VMWare tools=== |
||
+ | |||
====Workstation Player==== |
====Workstation Player==== |
||
− | + | When you see REBOOT, reboot and login (wwadmin/wwadmin) |
|
− | + | ||
− | + | Do not accept any updates (save disk space) |
|
Check if tools are installed |
Check if tools are installed |
||
vmware-toolbox-cmd -v |
vmware-toolbox-cmd -v |
||
− | and if so, remove them |
+ | (they should be) and if so, remove them |
− | + | ||
+ | sudo apt remove open-vm-tools |
||
+ | sudo apt autoremove |
||
Line 42: | Line 40: | ||
sudo apt install openssh-server |
sudo apt install openssh-server |
||
− | + | Find the ip address of your guest |
|
The Guest IP is the IP address your guest WeBWorK server is using. You can find it (after you login) by entering the command |
The Guest IP is the IP address your guest WeBWorK server is using. You can find it (after you login) by entering the command |
||
$ ip address show |
$ ip address show |
||
− | and looking at the output, something like |
+ | and looking at the output, something like |
− | + | link/ether 00:0c:29:4f:2c:1d brd ff:ff:ff:ff:ff:ff |
|
− | + | inet 192.168.204.128/24 brd 192.168.204.255 scope global dynamic ens33 |
|
− | Find or download the vmnetcfg.exe program. This does not come with Workstation Player but it does come with Workstation Pro. Download Workstation Pro (Do not install it) and |
||
− | look for this program where you installed things. |
||
− | Run the command as root (or administrator on Windows) |
||
− | vmnetcfg.exe |
||
− | and configure NAT for port forwarding. Say localhost:2222 to e.g. 10.0.2.15:22 |
||
− | ====Workstation Pro==== |
||
− | |||
− | |||
====Login from Terminal program==== |
====Login from Terminal program==== |
||
At this point you can login to your server from your host machine using SSH (non secure telnet and FTP are not allowed but secure SSH and SFTP are) using your favourite terminal emulator program. |
At this point you can login to your server from your host machine using SSH (non secure telnet and FTP are not allowed but secure SSH and SFTP are) using your favourite terminal emulator program. |
||
− | E.g. set your terminal to connect to |
+ | E.g. set your terminal to connect to 192.168.204.128 |
+ | |||
You can do all of the remaining installation from a terminal emulator on your host. The advantage of doing this is that you can copy commands from these instructions (with copy from the Edit menu or ^C) and paste them into a terminal window (with paste from the Edit menu list or <Shift> <Ctrl> <V> or <Shift> <Insert> depending on your application). |
You can do all of the remaining installation from a terminal emulator on your host. The advantage of doing this is that you can copy commands from these instructions (with copy from the Edit menu or ^C) and paste them into a terminal window (with paste from the Edit menu list or <Shift> <Ctrl> <V> or <Shift> <Insert> depending on your application). |
||
+ | ===Follow the standard instructions=== |
||
+ | |||
+ | ====site.conf and localoverrides.conf==== |
||
+ | # use the ip address (e.g. 192.168.201.128) everywhere. Do not use localhost |
||
# set password for webworkWrite (wwadmin) |
# set password for webworkWrite (wwadmin) |
||
+ | |||
+ | === set up MyTestCourse=== |
||
# add practice users and jsmith/jsmith to myTestCourse |
# add practice users and jsmith/jsmith to myTestCourse |
||
+ | # add profa |
||
# add the standard sets to myTestCourse |
# add the standard sets to myTestCourse |
||
− | # implement all options A-E except C (run WW through SSL) |
||
+ | # set open, close and answer dates (adjust years): |
||
+ | Open Date Close Date Answer Date |
||
+ | |||
+ | |||
+ | Demo 01/10/2024 at 06:00am 01/10/2031 at 06:00am 01/10/2031 at 06:00am |
||
+ | |||
+ | Orientation 02/01/2021 at 06:00am 02/01/2031 at 06:00am 02/01/2031 at 06:00am |
||
+ | |||
+ | === Add administrator admin1 to admin course === |
||
− | ====Remove openssh-server==== |
||
+ | Add administrator admin1 to admin course with password admin1. Then log om as admin1 and reset two factor authentication |
||
+ | for user admin. |
||
+ | ===Implement options B and C (not A, SSL) === |
||
+ | ===Implement Housekeeping (cron jobs) === |
||
− | sudo apt remove openssh-sftp-server |
||
+ | ====Clean up the system==== |
||
+ | * rm apache's error.log's in /var/log/apache2/ |
||
+ | * rm apache's access.log's in /var/log/apache2/ |
||
+ | * rm webwork's timing.log's in /opt/webwork/webwork2/logs/ |
||
+ | * Remove unneeded backup's in /opt/webwork/webwork2/conf/ |
||
+ | * Remove contents of /var/www/html/wwtmp/ |
||
− | Export to an .ova file. |
||
+ | wwadmin@wwserver:~$ du -sh /var/cache/apt/archives/ |
||
+ | du: cannot read directory '/var/cache/apt/archives/partial': Permission denied |
||
+ | 71M /var/cache/apt/archives/ |
||
+ | wwadmin@wwserver:~$ sudo apt clean |
||
+ | [sudo] password for wwadmin: |
||
+ | wwadmin@wwserver:~$ du -sh /var/cache/apt/archives/ |
||
+ | du: cannot read directory '/var/cache/apt/archives/partial': Permission denied |
||
+ | 44K /var/cache/apt/archives/ |
||
+ | |||
+ | |||
+ | sudo apt autoremove --purge |
||
+ | |||
+ | |||
+ | |||
+ | ====Reset Two factor Authentication==== |
||
+ | Reset Two factor Authentication for admin in the admin course |
||
+ | Reset Two factor Authentication for admin in the myTestCourse course |
||
+ | |||
+ | ====Reset CPU's amd Memory==== |
||
+ | Set the memory to 4 GB and processors to 2 |
||
+ | |||
+ | ===Export to an .ova file=== |
||
====Workstation Player==== |
====Workstation Player==== |
||
− | Find the path to your VM |
+ | Find the path to your VM. |
+ | |||
Open a command prompt as administrator |
Open a command prompt as administrator |
||
− | cd D:\program files\vmware\vmware OVF_Tool |
||
− | Enter |
||
− | type ovftool “C:\the path to your VM\your VMname.vmx” c:\new directory\name.ova |
||
+ | E: |
||
+ | cd \Programs\VMware\OVFTool\ |
||
+ | |||
+ | Enter |
||
+ | ovftool --maxVirtualHardwareVersion=13 “C:\the path to your VM\your VMname.vmx” c:\new directory\name.ova |
||
+ | where you should pick the highest hardware version which is still low enough to support all currently supported VMware products. |
||
+ | |||
+ | E.G. |
||
+ | E:\Programs\VMware\OVFTool>ovftool --maxVirtualHardwareVersion=13 "C:\Users\arnol\OneDrive\Documents\Virtual Machines\WW2.17_Ubuntu22.04_Server.vmx" "C:\Virtual Machines\OVA_Files\WW2.17_Ubuntu22.04_Server.ova" |
||
+ | |||
+ | The double quotes are needed because file names have spaces. |
||
[[Category:Developers]] |
[[Category:Developers]] |
Latest revision as of 10:31, 10 August 2024
Contents
Instructions for creating a WeBWorK Virtual Machine (.OVA) Image
Note that the resulting .ova image can be used to create a virtual machine
Build the server on VMWare Workstation Player
- 30 GBk disk (single file)
- 4 GB memory
- 2 cpu
The above resources are small.
- Download the ubuntu live CD (server version)
- Install following the standard directions with the following options
- Don't partition disks separately
- User name: wwadmin
- login: wwadmin
- password: wwadmin
- Computer name: wwserver
Workstation Player
When you see REBOOT, reboot and login (wwadmin/wwadmin)
Do not accept any updates (save disk space)
Check if tools are installed
vmware-toolbox-cmd -v
(they should be) and if so, remove them
sudo apt remove open-vm-tools sudo apt autoremove
After system boots check that openssh-server is installed
run
sudo lsof -i -P -n | grep LISTEN
to check if it is listening on port 22 If not install openssh-server
sudo apt install openssh-server
Find the ip address of your guest The Guest IP is the IP address your guest WeBWorK server is using. You can find it (after you login) by entering the command
$ ip address show
and looking at the output, something like
link/ether 00:0c:29:4f:2c:1d brd ff:ff:ff:ff:ff:ff inet 192.168.204.128/24 brd 192.168.204.255 scope global dynamic ens33
Login from Terminal program
At this point you can login to your server from your host machine using SSH (non secure telnet and FTP are not allowed but secure SSH and SFTP are) using your favourite terminal emulator program. E.g. set your terminal to connect to 192.168.204.128
You can do all of the remaining installation from a terminal emulator on your host. The advantage of doing this is that you can copy commands from these instructions (with copy from the Edit menu or ^C) and paste them into a terminal window (with paste from the Edit menu list or <Shift> <Ctrl> <V> or <Shift> <Insert> depending on your application).
Follow the standard instructions
site.conf and localoverrides.conf
- use the ip address (e.g. 192.168.201.128) everywhere. Do not use localhost
- set password for webworkWrite (wwadmin)
set up MyTestCourse
- add practice users and jsmith/jsmith to myTestCourse
- add profa
- add the standard sets to myTestCourse
- set open, close and answer dates (adjust years):
Open Date Close Date Answer Date
Demo 01/10/2024 at 06:00am 01/10/2031 at 06:00am 01/10/2031 at 06:00am
Orientation 02/01/2021 at 06:00am 02/01/2031 at 06:00am 02/01/2031 at 06:00am
Add administrator admin1 to admin course
Add administrator admin1 to admin course with password admin1. Then log om as admin1 and reset two factor authentication for user admin.
Implement options B and C (not A, SSL)
Implement Housekeeping (cron jobs)
Clean up the system
- rm apache's error.log's in /var/log/apache2/
- rm apache's access.log's in /var/log/apache2/
- rm webwork's timing.log's in /opt/webwork/webwork2/logs/
- Remove unneeded backup's in /opt/webwork/webwork2/conf/
- Remove contents of /var/www/html/wwtmp/
wwadmin@wwserver:~$ du -sh /var/cache/apt/archives/ du: cannot read directory '/var/cache/apt/archives/partial': Permission denied 71M /var/cache/apt/archives/ wwadmin@wwserver:~$ sudo apt clean [sudo] password for wwadmin: wwadmin@wwserver:~$ du -sh /var/cache/apt/archives/ du: cannot read directory '/var/cache/apt/archives/partial': Permission denied 44K /var/cache/apt/archives/
sudo apt autoremove --purge
Reset Two factor Authentication
Reset Two factor Authentication for admin in the admin course Reset Two factor Authentication for admin in the myTestCourse course
Reset CPU's amd Memory
Set the memory to 4 GB and processors to 2
Export to an .ova file
Workstation Player
Find the path to your VM.
Open a command prompt as administrator
E: cd \Programs\VMware\OVFTool\
Enter
ovftool --maxVirtualHardwareVersion=13 “C:\the path to your VM\your VMname.vmx” c:\new directory\name.ova
where you should pick the highest hardware version which is still low enough to support all currently supported VMware products.
E.G. E:\Programs\VMware\OVFTool>ovftool --maxVirtualHardwareVersion=13 "C:\Users\arnol\OneDrive\Documents\Virtual Machines\WW2.17_Ubuntu22.04_Server.vmx" "C:\Virtual Machines\OVA_Files\WW2.17_Ubuntu22.04_Server.ova"
The double quotes are needed because file names have spaces.