Start VM in virtualbox headless mode

I want to start my VM virtualbox but without the GUI interface, cause if I need to get the access to my VM, I just can SSH into it. So it won’t need any GUI interface and I don’t have to open up Virtualbox first to start my VM.

This is a simple command line to start up your VM in headless mode, once it gets started, you can just SSH into your VM.

VBoxManage startvm myubuntu --type headless

Poweroff your VM with command line:

VBoxManage controlvm myubuntu poweroff

Or you can just init 0 in your VM when you’re done, LOL


Django table is marked as crashed and should be repaired

My django app is showing 500 because one of the tables in database marked crashed and should be repaired.

InternalError at /

(145, "Table './dbname/django_session' is marked as crashed and should be repaired")

I thought it was just an usual error from mysql and needed to restart but it wasn’t.

Solutions:

 Login to mysql, select your dbname, and use this command:

USE user_base;
REPAIR TABLE TABLE;