rc.local executes as the final stage of boot. You need to wait until it would normally ask for your login credentials if a screen was plugged in. At the start of boot, nothing is ready, booting is setting everything up. You could made the boot time faster, though.