Guest User

Untitled

a guest
Jul 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. NAME=$1
  4. if [ "$NAME" == "" ]; then
  5. exit 1;
  6. fi
  7. VBoxManage startvm "${NAME}" --type headless
  8. IPVALUE=$(VBoxManage guestproperty wait "${NAME}" "/VirtualBox/GuestInfo/Net/0/V4/IP")
  9. wait $!
  10. IPFIELD=($IPVALUE)
  11. IP=${IPFIELD[3]:0:-1}
  12. echo $IP
  13. ssh $IP
Add Comment
Please, Sign In to add comment