Magisk v14.4 Brings Root to the Pixel 2 XL
Magisk for the Pixel 2 XL starts with version 14.4, and so far the developer has only tested it on Android 8.0 OPD1.170816.010 but says that, in theory, it should work on the 8.1 beta as well. This method does not need root, and also does not require a custom recovery.
See http://bit.ly/2i4X8oA and see a step-by-step guide to using Magisk at https://android.gadgethacks.com/how-to/root-pixel-2-pixel-2-xl-install-magisk-0181117/