how to obtain ipv4 address of ubuntu server running in virtual box along with ipv6?

Apart from the bridged mode, I had to disable ipv6 as per this post to get it working: https://superuser.com/questions/1146122/ubuntu-virtualbox-guest-does-not-get-ipv4-in-bridged-mode/1148247#1148247?newreg=7c77aaf0882540148a3700242cd05d0b

Pasting the steps from above: Open /etc/default/grub

In this file, find this line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

and change it to:

GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 quiet splash"

Save the file and update GRUB by running:

sudo update-grub

Now reboot the VM. Next time it comes up with appropriate ipv4 address.