Vagrant: X Window Доступ к системе возможен?

4476
John Sonderson

Помимо доступа по SSH, возможно ли также использовать Vagrant для запуска надлежащего сеанса с запущенной системой X Window и оконным менеджером, таким как Unity, чтобы также был доступен графический интерфейс?

(Я использую VirtualBox по умолчанию с окном Precision32.box, не знаю, почему я хотел бы переключиться на что-нибудь еще, например, VMware).

Благодарю.

5

1 ответ на вопрос

6
John Sonderson

OK, I've figured it out.

Once you issue the "vagrant up" command, the disk image is placed under the "C:\Users\MyUserName\VirtualBox VMs" directory with all files required for it to be operational, and hence shows up in the list when you launch VirtualBox. If you shutdown the system with the "vagrant halt" you can then boot into it directly form VirtualBox. Since logging in with username "vagrant" and password "vagrant" will drop you into a shell and there will be no X Window System installed, you will want to issue sudo apt-get install xinit and then sudo apt-get install unity and sudo apt-get install gnome. This however won't be enough for the startx command to work. What you should do instead is issue sudo apt-get install ubuntu-desktop. You can then issue the startx command to access the X Window System's graphical user interface running Gnome and Unity. You can, of course, also configure a shell script to be executed automatically after booting the system to install these packages by creating a script and setting it up to run automatically by inserting its name in the Vagrantfile.

Похожие вопросы