Port forwarding on virtual box

Hi guys, I have a problem I’m trying to solve, hopefully, someone can help. The problem is port forwarding I am trying to port forward and nothing has worked I am running a VM on windows in Virtual Box but when I changed the network adapter from bridged to NAT I couldn’t access the URL to go to the home assistant page. However, when I checked canyouseeme.org and I put the ports 443 and 8123, it worked but when I was on the bridged it didn’t work please help.

I (feel) I have done everything else like firewalls have been disabled I don’t have an anti-virus and most other things, if you think I might have not done a step please do say.

Thank you.

When you are bridged, the virtual machine asks the router directly for an IP address and can have ports forwarded to it. (Don’t forward 8123 to it, if you have port 443 working). When you set the mode to NAT, it doesn’t ask the router for an IP address Virtualbox gives it an IP address inside the Virtualbox ONLY network, in this mode you would need to port forward to the PC running virtualbox, rather than to the virtual machine itself - though I am not entirely sure how this configuration works myself to be honest, because then you are dealing with double NAT which makes everything a headache to troubleshoot. I believe when you are using the NAT mode, that you need to access Home Assistant via it’s NAT IP which you probably can’t do - because the SSL certificate will probably complain.