Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
10-08-2014, 02:59 PM
|
#16
|
Senior Member
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860
|
Yeah, I know. The OP's use case seems legitimate, however; at least I can see why he would want to do it that way.
|
|
|
10-09-2014, 04:08 AM
|
#17
|
Member
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 531
|
Looks like the OP is using snapshots of a static "gold image" to generate the new VMs' virtual hard drive.
One way to get the desired result is to make 2 snapshots (one with init3, one with init4) and use a snapshot of those as the new VM virtual hard drive...
This way, the script used to generate the VM would decide which init will be used, not a script inside the VM.
|
|
|
10-09-2014, 06:50 AM
|
#18
|
Senior Member
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860
|
Then you have to remember to change two images instead of merely one. (Your way is how I'd probably do it, to tell the truth, but I can see why someone else would want to maintain only one image.)
Of course the additional advantage of your way is that adding a new special MAC address doesn't require re-creating the VM image to include that address for the internal test. I guess that the path of least resistance depends upon which changes the fastest: the list of special MAC addresses or the contents of the VM image (outside of the special MAC address list).
|
|
|
10-09-2014, 07:53 AM
|
#19
|
Member
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 531
|
Quote:
Originally Posted by Richard Cranium
Then you have to remember to change two images instead of merely one. (Your way is how I'd probably do it, to tell the truth, but I can see why someone else would want to maintain only one image.)
|
You don't have to change any images.
This is what he uses:
read_only_gold_image --> snapshot
This is what I would use:
read_only_gold_image --┬-> read_only_snapshot_init3 --> snapshot
.................................└-> read_only_snapshot_init4 --> snapshot
Last edited by Slax-Dude; 10-09-2014 at 07:58 AM.
Reason: stupid ascii
|
|
|
10-09-2014, 08:05 AM
|
#20
|
Member
Registered: Apr 2014
Distribution: Slackware
Posts: 98
Original Poster
Rep:
|
That's two images to manage.
|
|
|
10-09-2014, 08:33 AM
|
#21
|
Member
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 531
|
They are read_only static snapshots, that take a few Kb of space... there is not much to "manage".
You already do this with your "read-only Qemu image", yes?
Quote:
Originally Posted by nolretou
I have a read-only Qemu image with a test script launched by rc.local .
I create many relative images with different MAC addresses.
|
|
|
|
10-09-2014, 08:40 AM
|
#22
|
Member
Registered: Apr 2014
Distribution: Slackware
Posts: 98
Original Poster
Rep:
|
They are not modified.
|
|
|
10-09-2014, 09:33 AM
|
#23
|
Member
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 531
|
No, they are not.
Like I said, they are read-only
That is why I don't understand what you mean by "That's two images to manage".
Manage what?
Since the dynamic changing from init3 to init4 seems complicated, I thought of an alternative solution.
Please disregard if it does not help in your use case.
|
|
|
10-09-2014, 09:35 AM
|
#24
|
Member
Registered: Apr 2014
Distribution: Slackware
Posts: 98
Original Poster
Rep:
|
According to your setup, both images have a different setup. One is rc.3, other is rc.4.
|
|
|
10-09-2014, 09:51 AM
|
#25
|
Member
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 531
|
Quote:
Originally Posted by nolretou
According to your setup, both images have a different setup. One is rc.3, other is rc.4.
|
Yes, but only have to change the snapshots once, on creation, then use them the same way you use your current image (read-only) on every new VM you make.
When you make a new VM you are using snapshots, right?
Last edited by Slax-Dude; 10-09-2014 at 10:28 AM.
|
|
|
10-10-2014, 04:18 AM
|
#26
|
Member
Registered: Apr 2014
Distribution: Slackware
Posts: 98
Original Poster
Rep:
|
Quote:
Originally Posted by Richard Cranium
Bad advice on my part. You shouldn't exit rc.4, but stay in it; the display managers that are launched aren't running as daemons.
So instead of exiting, run in a while loop with a sleep like so...
Code:
while /bin/true; do sleep 10; done
|
Tested it, it works.
I mark the thread as solved although I'm open for any other solution.
|
|
|
10-10-2014, 07:28 PM
|
#27
|
Senior Member
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860
|
Aha.
qemu appears to accept an "-append" option (from "man qemu" and scrolling down a hell of a lot)...
Code:
-append cmdline
Use cmdline as kernel command line
...so you can have exactly one VM image that has its default initlevel at 3. Move your "which ones do I want to use runlevel 4" logic out of the VM and into whatever is launching the VMs. Just add "-append 4" to the qemu command line for those special VMs and they should goto runlevel 4 when they start.
(Any runlevel that you provide on the kernel command line overrides /etc/inittab)
Last edited by Richard Cranium; 10-10-2014 at 07:29 PM.
Reason: It might be nice to know where I found that info.
|
|
2 members found this post helpful.
|
10-13-2014, 03:05 AM
|
#28
|
Member
Registered: Apr 2014
Distribution: Slackware
Posts: 98
Original Poster
Rep:
|
The -append is only allowed with the -kernel option, which I don't use.
|
|
|
All times are GMT -5. The time now is 05:22 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|