So, following this https://www.adayinthelifeof.nl/2012/12/20/debugging-remote-cli-with-phpstorm/, I found out that you need to specify the remote host.
Xdebug must know where to send the data to.
I ended up editing my xdebug configuration to look like this:
[XDEBUG]
xdebug.max_nesting_level=200
xdebug.remote_connect_back=1
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.idekey=netbeans-xdebug
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.collect_params=4
xdebug.remote_host=HOST_IP #changed this, removed remote_autostart
So now you just have to turn debugging on in Netbeans and run export XDEBUG_CONFIG="idekey=netbeans-xdebug"
in your VM's console.
Next run the script you want to debug.