Problem installing build-essential package

I just started the Web 101 track and I’m trying to prepare a work environment. I’ve installed Xubuntu (18.04) in the VirtualBox (6.1.10) and host machine runs Windows 10.

But when I try to install the build-essential package, or any package, I get the “Unable to locate package {…}” message. Actually any task that requires internet connection fails. What can I do to solve this problem?

Additional information:

  • I can ping and it works fine, but trying to load page with the web browser fails to Connection Timed Out
  • I tried to attach the network adapter to NAT and also Bridged Adapter, but none of them solved my problem.