Successfully opened terminal window and executed commands using this code
# Open an xterminal in colab
!pip install colab-xterm
%load_ext colabxterm
%xterm
#Then ran following commands in window
curl -fsSL https://ollama.com/install.sh | sh
ollama serve & ollama pull llama3 & oll