Add attach functionality

Currently, it fails on WaitForSync.