Enable port forwarding on VirtualBox Machine from 2376 on host to 2376 on guest (Settings > Network > Adapter 1 NAT > Advanced > Port Forwarding), and then export the following in a shell. Docker Compose and other docker tools will work as expected.
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://localhost:2376"
For docker-machine users:
export DOCKER_MACHINE_NAME="default"
export DOCKER_CERT_PATH="${HOME}/.docker/machine/machines/${DOCKER_MACHINE_NAME}"
For boot2docker users:
export DOCKER_CERT_PATH=$HOME/.boot2docker/certs/boot2docker-vm
Docker Compose
# Assuming 'app' is the name of the main container in docker-compose.yml
docker-compose run app bash