Recent Comments
- Spitzenpfeil on Sleep is vital
- robert on PT4115 LED-Square
- abies on PT4115 LED-Square
- robert on ERSA I-Con Nano — A pico review
- Ubi de Feo on ERSA I-Con Nano — A pico review
Archives
Tags
64-pixels adapter AVR bulb customs DSO failure by design fireworks firmware good old days hack happy new year hardware IKEA import lamp lecroy LED light lighting linux MBI5168 modding open source opensuse oscilloscope PCB power supply prototype PWM rant remote RGB RoHS Samtid Seeedstudio SMD soldering teardown trigger upgrade WaveAce 224 weller WS2812B youyueCategories
- Computer / Server (21)
- Dear Diary. (13)
- DIY. (12)
- Electronics. (192)
- Arduino. (44)
- Fix me. (13)
- Soldering & PCBs. (39)
- Software. (11)
- Something Completely Different (10)
- The Dump. (28)
Blogroll
KiCad
Links
My 2µF
Meta
Tag Archives: mischief
VirtualBox mischief – getting rid of too many pesky users
This requires VirtualBox guest additions to be installed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
#!/bin/bash VM_NAME="deb test" MAX_USERS=2 RUNNING_VMS=`VBoxManage list runningvms` OUR_VM_IS_RUNNING=`echo ${RUNNING_VMS} | grep "${VM_NAME}"` if [[ -z ${OUR_VM_IS_RUNNING} ]] then echo -e "VM \"${VM_NAME}\" not running...\nBye!" exit fi LOGGED_IN_USERS=`VBoxManage guestproperty enumerate "${VM_NAME}" | grep "/OS/LoggedInUsers, value" | awk '{split($4,a,","); print a[1]}'` if [[ ${LOGGED_IN_USERS} -gt ${MAX_USERS} ]] then echo "Checking VM: \"${VM_NAME}\"..." echo "${LOGGED_IN_USERS} logged in. Maximum allowed: ${MAX_USERS}" echo "Shutting down \"${VM_NAME}\" ..." VBoxManage controlvm "${VM_NAME}" savestate else echo "Checking VM: \"${VM_NAME}\"..." echo "${LOGGED_IN_USERS} logged in. Maximum allowed: ${MAX_USERS}" echo "Phew ..." fi |
Posted in Computer / Server
Tagged linux, mischief, scripting, VBoxManage, VirtualBox, virtualization
Comments Off on VirtualBox mischief – getting rid of too many pesky users