y is for yanking within vim
Use "+ to copy to the system clipboard
Thus use "+y instead of y
Likewise you can paste using "+ to get text from the system clipboard
i.e. "+p instead of just p
"* <- this will set the register for system (ubuntu and macos)
While on Visual Mode select desired text then type "*y
For paste go to Visual Mode and type "*p