See below in the screenshot that copy is disabled by visual mode which enables automatically:
Fix it by setting this .vimrc option:
echo "set mouse-=a" >> ~/.vimrc
vi, visual, mode, solutionsee, screenshot, disabled, enables, automatically, vimrc, echo, quot,