{"id":3002,"date":"2020-08-13T14:16:10","date_gmt":"2020-08-13T11:16:10","guid":{"rendered":"http:\/\/surgery.moscow\/smos\/?p=3002"},"modified":"2020-08-18T15:42:52","modified_gmt":"2020-08-18T12:42:52","slug":"virtualbox-reboot-start","status":"publish","type":"post","link":"https:\/\/surgery.moscow\/smos\/2020\/08\/13\/virtualbox-reboot-start\/","title":{"rendered":"VirtualBox reboot start"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">How to start virtualBox machine after reboot on linux <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">add line in crontab with :  <strong>crontab -e<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>@reboot VBoxHeadless &#8212;startvm &#171;<\/strong>uuid or name virtual machine<strong>&#187; &amp;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0427\u0442\u043e\u0431\u044b VirtualBox \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u043b \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>#!\/bin\/bash<br>#\u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d  \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f  user_name<br>#<br>\/usr\/bin\/sudo -u user_name \/usr\/bin\/VBoxHeadless &#8212;startvm f4c41e45-a4c7-47f8-b12a-a6b3eaa59820 &amp;<br>\/usr\/bin\/sudo -u <strong>user_name<\/strong> \/usr\/bin\/VBoxHeadless &#8212;startvm 3e7d8c99-91ea-481c-9125-6e9a243df82b &amp;<\/strong><br><br>\u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 <strong>crontab <\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>AutoStart \u0447\u0435\u0440\u0435\u0437 service start \u0432   centos8<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \/etc\/systemd\/system\/vm-start.service <\/strong> <br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>[Unit]<br>Description=VBox Virtual Machine %i Service<br>Requires=systemd-modules-load.service<br>After=systemd-modules-load.service<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>[Service]<br>User=user<br>Group=vboxusers<br>ExecStart=\/usr\/bin\/VBoxHeadless -s %i<br>ExecStop=\/usr\/bin\/VBoxManage controlvm %i savestate<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>[Install]<br>WantedBy=multi-user.target<br><\/strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br><br>\u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable vboxvmservice@vm_uuid.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to start virtualBox machine after reboot on linux add line in crontab with : crontab -e @reboot VBoxHeadless &#8212;startvm<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,12,22],"tags":[],"class_list":["post-3002","post","type-post","status-publish","format-standard","hentry","category-computer","category-internet","category-technology"],"_links":{"self":[{"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/posts\/3002","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/comments?post=3002"}],"version-history":[{"count":11,"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/posts\/3002\/revisions"}],"predecessor-version":[{"id":3037,"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/posts\/3002\/revisions\/3037"}],"wp:attachment":[{"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/media?parent=3002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/categories?post=3002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/tags?post=3002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}