Fairly new to xen. Working on getting Ubuntu Precise set up on a guest. I was under the impression that using a command line such as xen-create-image --boot blah blah would configure and start the VM, then run /etc/rc.local but that does not seem to be the case. How does one get a script to run when the new guest is first started, before logging in and doing it by hand? What am I missing? mjb.
Hi there mark - that would really depend on your distro - that''s not a function of Xen at all as far as I know - the guest boots and what the guest does is the guest''s business. Some distro''s might use rc.local - others might use run-level changes, or other script sets - but what you have to do within a xen guest has always been the same as when running the guest os natively from my experience. Hope that helps. m -----Original Message----- From: xen-users-bounces@lists.xen.org [mailto:xen-users-bounces@lists.xen.org] On Behalf Of Mark J Bradakis Sent: December 9, 2013 5:02 PM To: xen-users@lists.xen.org Subject: [Xen-users] rc.local? Fairly new to xen. Working on getting Ubuntu Precise set up on a guest. I was under the impression that using a command line such as xen-create-image --boot blah blah would configure and start the VM, then run /etc/rc.local but that does not seem to be the case. How does one get a script to run when the new guest is first started, before logging in and doing it by hand? What am I missing? mjb. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Hello. El 09/12/13 19:01, Mark J Bradakis escribió:> xen-create-image --boot blah blah > > would configure and start the VM, then run /etc/rc.local but that does > not seem to be the case. > > How does one get a script to run when the new guest is first started, > before logging in and > doing it by hand? What am I missing?If you deploy a Debian or Ubuntu DomU with help of xen-create-image, it will run it''s own /etc/rc.local on startup, not because xen-create-image made it to do so, but because the distribution is organized that way. By default, this script does nothing. There are several ways to make your new DomU to run custom scripts on startup. 1. You may use /etc/xen-tools/skel/etc/rc.local to deploy a custom version of the script. You even may trick it, so it run something at first boot and modify itself in order to do noting on subsequent boots. 2. You may deploy a custom script with everything you need but run it by hand, to have more control (I do that myself). 3. You may use /etc/xen-tools/role.d/something to make xen-create-image to run custom commands while creating the image, even before it boots. 4. You may install some puppet or chief agent by default on each DomU you deploy, and manage them from a central location. Greetings. -- Alexandre Kouznetsov