There are a couple of small changes to gregko and hayder Jawad's answer to get this working on the Pixel 2 emulator.
You have to start the emulator using the -writable-system
flag as per this answer, otherwise you won't be able to remount the /system
directory with the rw flag.
On the Pixel 2 emulator, /system
is mounted at /dev/block/vda
and /system/xbin
already exists.
Thus, assuming you've pushed the binary to /data/local/busybox
as per the first half of the answer, the shell commands to install busybox into the Pixel 2 emulator are
su
cd /data/local
chmod 755 busybox
./busybox
mount -o rw,remount -t ext4 /dev/block/vda /system
cp /data/local/busybox /system/xbin
cd /system/xbin
busybox --install .
mount -o ro,remount -t ext4 /dev/block/vda /system
sync
reboot
The busybox download page might be a bit unclear for beginners (like me). For 32-bit x86 processors, you'll want to use the i686 binary file.